On 22.03.2008, at 08:45, Gustavo Pizano wrote:

if I do that,  i understand you mean something like this, no?

<Picture 1.png>

if that's so. then I can have the following data.
id      id_person       id_convocation

1               01                      1
2               01                      1

which its not accepted because a person can't be twice in the same convocation.

Im checking the relationship of this 2 tables and don't see the m:n , im gonna make the relationships again and take care about that relationship.

As JVF said "You will have to model the middle table as an entity by itself, so give it a meaningful name (?Assignment?Meeting? Appointment?). You will end up with Person <-->> ?Appointment? <<--> Convocation."
I know that, but I though that middle table was PersonXConvocation.

Im not getting it there... :(

Gus

PS I changed the study_level_id to id_study_level already, just that its not reflected on the picture.

So, the problem is the following: you are modeling a m:n relationship with an additional attribute on it. So yes, if you don't want duplicates, you'll need to check for them. There are several ways doing this e.g. using a unique constraint on the database and catching errors, checking in the validateForSave method and so on.

It's just something you have to take care of. That's all.

With the current datamodel your person can have many convocations. Is that intended? If not, model a 1:n relationship and keep the state somewhere else. Or check for duplicates and avoid them in your application logic.

cug

--
http://www.event-s.net

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to