Are you using inheritance with entities in different tables? Having the same PK in two different tables (e.g. from manual editing) will confuse EOF into thinking one object is two or vice versa). I had a similar problem recently and traced it back to a duplicated PK.

On Jun 16, 2007, at 9:37 AM, Simon McLean wrote:

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to