|
|
yea, it is a many to many. I put both validateForInsert and ForSave with logs to see them fire. I think I need to check for duplicates in the validateForSave.
so here is the quandary there is an entity Event. an event has a show and a show has an array of books. people are assigned to books. right now Jon is assigned to book 1 of event.show.LionKing.
If I edit the books (EditRelationshipEmbeddedEventBook) I can assign Jon to two books. This is what I am trying to eliminate. The possibility of a human error (that means that Jon gets paid twice.)
Whoops
Ideas?
Ted
On 2/23/26 7:52 PM, Aaron Rosenzweig wrote:
If it’s strictly a toMany relationship, I don’t see how they could be added twice.
Is it a many-to-many? In that case, the same person could be added twice. In that case, I’d put the validateForInsert() on the join table. I’d try to find at least one other join table pointing to the same person and entity.
On Feb 23, 2026, at 5:50 PM, Theodore Petrosky <tedpet5@yahoo.com> wrote:
I am trying to add a check in validateForSave. my entity has a toMany relation with my Person entity. I need to check if a person has been added twice.
So basically, if Jon has been added twice throw the validation exception. so I guess, here is an array of persons, are they all unique?
Am I being clear?
public void validateForSave() throws NSValidation.ValidationException {
Ted
BTW, I tried to send this to webobjects-dev@lists.apple.com, but it looks like it has been down for a couple of days or longer.
#############################################################
This message is sent to you because you are subscribed to
the mailing list <webobjects-dev@wocommunity.org>.
To unsubscribe, E-mail to: <webobjects-dev-off@wocommunity.org>
To switch to the DIGEST mode, E-mail to <webobjects-dev-digest@wocommunity.org>
To switch to the INDEX mode, E-mail to <webobjects-dev-index@wocommunity.org>
Send administrative queries to <webobjects-dev-request@wocommunity.org>
|
|