Re: Duplicate objects in a relationship
Re: Duplicate objects in a relationship
- Subject: Re: Duplicate objects in a relationship
- From: Simon McLean <email@hidden>
- Date: Mon, 18 Jun 2007 00:22:55 +0100
Hi Chuck - I am using inheritance, but of the single table variety:
Is the restricting qualifier unique across all entities? Do the
abstract ones have a restricting qualifier?
Yes, and yes.
Client has a parent called AbstractOrganisation, EmployeeRole has
a parent called AbstractUserRole which are mapped to
ABSTRACT_ORGANISATION and ABSTRACT_USER_ROLE tables. The
problematic relationship is inherited from the parent - so getRoles
() actually returns an array of AbstractUserRoles, and the reverse
relationship getOrganisation() returns an AbstractOrganisation.
I tried moving the relationships from the parent down to the child
objects, but I get the same behavior. I've also checked the tables
for duplicate PK's but there aren't any.
Iterate over the objects in client.getRoles() and print out getClass
().getName(), entityName(), and hashCode() on each. I suspect you
may get a surprise.
Here is the output:
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
Which suggests there are definitely duplicates in there.
I've also noticed that not all Client objects are affected. In fact,
it looks like only a handful are. I guess this points to a data error ?
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