RE: Duplicate objects in a relationship
RE: Duplicate objects in a relationship
- Subject: RE: Duplicate objects in a relationship
- From: "Ruenagel, Frank" <email@hidden>
- Date: Mon, 18 Jun 2007 10:54:05 +0200
- Thread-topic: Duplicate objects in a relationship
Hi,
do you prefetch massively? I can remember a similar case that
I used "setPrefetchingRelationshipKeyPaths" with many and
long keypaths; this results in Duplicates and Triplicates...
The model was simple: no inheritance, the pks where unique.
Everythings works fine after I prefetch manually (looping)
The problem has something to do with:
An Entity appears multipe times in different
long prefetching-keypaths in one PrefetchingRelationshipKeyPaths-Array.
Frank
> -----Original Message-----
> From: webobjects-dev-bounces+webobjects=email@hidden
> [mailto:webobjects-dev-bounces+webobjects=symposion.de@lists.a
> pple.com]O
> n Behalf Of Simon McLean
> Sent: Monday, June 18, 2007 1:23 AM
> To: Chuck Hill
> Cc: WebObjects Dev Apple
> Subject: Re: Duplicate objects in a relationship
>
>
> >> 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:
email@hidden
This email sent to email@hidden
_______________________________________________
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