Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] two instances of same object in an indirectList ?

Hi Phillip,

I am a bit surprised that you are getting a TransparentList. I would expect a TransparentSet. Can you post the definition of the relationship?

-Tom

Phillip Ross wrote:
Hi all... I'm looking for some quick ideas.

Was wondering if someone could quickly think of a few things for me to check out with a problem I'm having.  I have a pair of entities with OneToMany relationships to a third entity.  If I return an instance with the entity manager using find and PK id, I get an instance and the Collection contains two items.  Both items are references to the same related object... exact hashCodes, etc.  When I run outside the container, the Collection is a HashSet and it only contains one reference to the related item due to the Set semantics which works great... but inside the container the Collection is an eclipselink specific IndirectList but with dups of the same item.

So, might there be something I'm doing wrong that's creating the dups in the indirect list?  I have several other similar OneToMany relations to other entities and they don't exhibit the problem, but I've been racking my mind trying to figure out if there is something I'm missing here to get the dedup to happen on the IndirectList.  There are several things I'm sure I could implement myself to work around all of this and handle deduping and such, but I'm really wondering why this duplication happens in the indirect list with these specific entities and not with the other three or four other similarly patterned OneToMany related entites.

Any ideas?  I'm using eclipselink 1.0.2, container is glassfish v2.1-b60e (tried with earlier glassfish versions as well).

Thanks!
- Phillip

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top