• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
adding multiple objects in a relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adding multiple objects in a relationship


  • Subject: adding multiple objects in a relationship
  • From: WebObjects <email@hidden>
  • Date: Fri, 17 Oct 2008 20:00:11 -0500

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);
System.out.println(localSelectedItems);

System.out.println("Did it!!");

myEC.saveChanges();

I select in the component the turns I want, I fetch them I display them I select them. so far so good.

It does all the process but when i go and see the db to see what is inside I realize that the join table, called here empxTurn, has only the last object of the NSArray localSelectedItems.

I tried doing this inside a for() clause and it has the same behavior.

what am I doing wrong.??/


Gus

PS Im happy there is no more migration problem!!! and no more NullPointerException using the AddObjecttoBothsidesOfRelatioship method.


 _______________________________________________
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

  • Follow-Ups:
    • Re: adding multiple objects in a relationship
      • From: Johann Werner <email@hidden>
    • Re: adding multiple objects in a relationship
      • From: Lachlan Deck <email@hidden>
  • Prev by Date: Re: Migrations and OpenBase
  • Next by Date: Re: do you want to blow your mind?
  • Previous by thread: Re: OpenBase (was:Webobjects-dev Digest, Vol 5, Issue 1018)
  • Next by thread: Re: adding multiple objects in a relationship
  • Index(es):
    • Date
    • Thread