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.
|