Duplicate objects in a relationship
Duplicate objects in a relationship
- Subject: Duplicate objects in a relationship
- From: Simon McLean <email@hidden>
- Date: Sat, 16 Jun 2007 17:37:09 +0100
Hi - I have a Client entity that has a toMany relationship to an
EmployeeRole object. If i print out the relationship client.getRoles
() there are duplicate objects being returned in the array:
(<com.clicktravel.travelsystem.EmployeeRole pk:"170">,
<com.clicktravel.travelsystem.EmployeeRole pk:"170">,
<com.clicktravel.travelsystem.EmployeeRole pk:"170">,
<com.clicktravel.travelsystem.EmployeeRole pk:"170">,
<com.clicktravel.travelsystem.EmployeeRole pk:"169">,
<com.clicktravel.travelsystem.EmployeeRole pk:"171">,
<com.clicktravel.travelsystem.EmployeeRole pk:"171">,
<com.clicktravel.travelsystem.EmployeeRole pk:"169">,
<com.clicktravel.travelsystem.EmployeeRole pk:"169">,
<com.clicktravel.travelsystem.EmployeeRole pk:"171">,
<com.clicktravel.travelsystem.EmployeeRole pk:"169">,
<com.clicktravel.travelsystem.EmployeeRole pk:"171">)
But if i print out this method that i have put in the Client class:
public NSArray roleCheck() {
return EOUtilities.objectsMatchingKeyAndValue(this.editingContext(),
"EmployeeRole", "organisation", this);
}
I get what i expected:
(<com.clicktravel.travelsystem.EmployeeRole pk:"170">,
<com.clicktravel.travelsystem.EmployeeRole pk:"169">,
<com.clicktravel.travelsystem.EmployeeRole pk:"171">)
This one has me baffled - i guess it must be a problem with my
model ?. Has anyone seen this before ?
Thanks, Simon
_______________________________________________
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