0
votes

just wanted to know how do I create an inverse relationship with one side being to-One RelationShip and other side being to-Many Relationship. Senario is that I am creating a chat messenger where I have "Contact" Entity and "Message" Entity. Now, what I want is that relationship from Message-->Contact should be to-One Relationship while Contact-->Message should be to-Many Relationship as one Contact can have multiple message. How do I set this? I have now added the screenshot for my data modal. Please have look and let me know. My P2PChat is ChatMessage Class and Contact is Contacts Class.

enter image description hereenter image description hereenter image description here

1
@SRS: How can you suggest entirely new content for a question asked by a different user? Do you have duplicate accounts? Please consider merging those, or at least posting the changes to your question via the correct username! - knedlsepp
Sorry for that. yeah I have two accounts - Rahul Singh

1 Answers

1
votes
  1. In your data model you need to add the relationships contact and messages to Message and Contact entities respectively.

  2. Select the inverse relationship of messages to be contact. (Or you could set the inverse of the of the contact relationship to be message, either way will work.) enter image description here

  3. Select the messages relationship on the Contact entity. Then change the 'Type' to 'To Many'.

enter image description here