multiple objects linked to one object

0
Hello, I try to build a simple phone book. So I have multiple people and each person can have multiple phone numbers assigned. In the form of the person, I have a button to create a phone number. But then the phone number shows up for all people. How do I link the phone number only to one person.
asked
1 answers
0

Hello Martin,

 

You can solve this by creating 2 associated entities, one person entity and one entity with the phone number, that are associated like this:

 

While creating a ContactDetails object, make sure you set the association to the associated person:

 

Afterwards, you can retrieve all the phone numbers of a person by retrieving all associated ContactDetails objects of a person over association. 

 

Kind regards,

 

Cas

 

EDIT: Apparently my screenshots haven't been uploaded, so I'll explain it through text. You can create a 1..* (one-to-many) association between the person entity and the entity with the phone number attribute (I use ContactDetails for this example). While creating the ContactDetails object, make sure you set the ContactDetails_Person association to the associated Person object, and you should be good to go.

answered