Re: adding multiple objects in a relationship
Re: adding multiple objects in a relationship
- Subject: Re: adding multiple objects in a relationship
- From: Lachlan Deck <email@hidden>
- Date: Sat, 18 Oct 2008 14:41:10 +1100
On 18/10/2008, at 12:00 PM, WebObjects wrote:
Hello, well after so much struggle, finally I have my app up and
running, but there is a problem.
for the people who knows what's my app all about, you will know that
an Employee can have multiple Turn, now, Im doing the following:
NSArray<Turn> localSelectedItems =
EOUtilities.localInstancesOfObjects(myEC, selectedItems());
EmployeeTurn empxTurn = (EmployeeTurn)
ERXEOControlUtilities.createAndInsertObject(myEC,"EmployeeTurn");
empxTurn.addObjectToBothSidesOfRelationshipWithKey(localEmployee,
EmployeeTurn.EMPLOYEE_KEY);
empxTurn
.addObjectsToBothSidesOfRelationshipWithKey(localSelectedItems,
EmployeeTurn.TURN_KEY);
Unless you've named this weirdly, TURN_KEY doesn't appear to be a
toMany key. i.e., it's not a plural. Check your model that there is
indeed a toMany relationship (and if accross a join that there's a
reverse toMany).
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden