Database Mgmt - UML - how to create only one instance of an entity linked to 2 strong entity

Dear all experts in Database mgmt & UML,


I am a sincere student trying to seek an answer that is part of my project so i was hoping some experts can enlighten me about it.

the situation is that an Account can only make ONE SINGLE VOTE (either like or dislike) to a Video

Say this is what it looks like when Account 1 votes Like on Video 1:

== Account 1 :: Vote (like) :: Video 1 ==

according to my modelling, another vote with a different voteStatus is possible duplicate in the system, which i do not want because only entitled to one vote for one video.

== Account 1 :: Vote (dislike) :: Video 1 ==

is created when the Account 1 dislikes the Video 1 after liking it previously.

so how do i solve this problem of ONLY ONE SINGLE VOTE instance belonging to ONE Account and ONE video ONLY??

Any answer would be appreciated greatly.
Thanks in advance.

You should have attached the image instead of linking it to a service that requires authentication and permissions.

Since I canโ€™t see your diagram, Iโ€™m going to be making a wild assumption here that your accounts hold a collection of videos with their associations representing votes. My solution to your issue would be to incorporate OCL to constrain the collection to a set of unique video associations thus eliminating duplicate votes.