In addition to Marc's explanation+
If the collection/map field is instantiated with a type more specific
than the declared type (either in field declaration or in no-arg
constructor), then the more specific type is used.

for example,
public class A {
    Collection f1 = new HashSet();
    List f2;
    public A() {
        f2 = new LinkedList();
    }
}

OpenJPA will use ProxyHashSet for f1 and ProxyLinkedList for f2. 


Pinaki Poddar
BEA Systems
415.402.7317  


-----Original Message-----
From: Dain Sundstrom [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 13, 2006 7:24 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: Are relation sets identity, pk or bean.equals() based?

On Dec 13, 2006, at 4:56 PM, Marc Prud'hommeaux wrote:

>> If you declare the field to be an interface type and you don't 
>> initialize the field to anything, I don't remember how we decide what

>> impl to use.
>
> Looking at the code in ProxyManagerImpl.java, it appears that we 
> default to ArrayList for fields declared as type Collection, HashSet 
> for fields declared as type Set, TreeSet for fields declared as type 
> SortedSet, and ArrayList for fields declared as type List.

Thanks! That is exactly what I wanted to know.

-dain
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Reply via email to