What I'm really asking is when OpenJPA loads a one-to-many field,
what kind of collection is injected into the bean? Is it a plain old
HashSet? If not, what does the collection use to determine equality
between elements?
-dain
On Dec 12, 2006, at 10:11 PM, Craig L Russell wrote:
> Hi Dain,
>
> On Dec 12, 2006, at 7:55 PM, Dain Sundstrom wrote:
>
>> If I have a one-to-many set, what is used to determine object
>> equality in the set: object identity, pk or bean.equals(other)?
>
> You are probably better off using database identity for equality.
> If all the elements are of the same persistent base class, you can
> probably use the id of the object as the key for comparisons.
>
> Craig
>>
>> -dain
>
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
|