Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Using a ContainerMapping with a Collection class that does not have a no-arg constructor

You could write your own ContainerPolicy for your list and set it on the
mapping.

Refer to the other container policies for an example, such as,
SortedCollectionContainerPolicy.


Mighty Mike wrote:
> 
> Hi everyone,
> I need to use a custom class that implements List as my collection for a
> ContainerMapping.  However, my custom List has a constructor with an
> argument.  Is there a way to tell EclipseLink to use a certain object as
> the
> argument to the constructor?  I could not find any mention in the
> documentation for ContainerMapping.useCollectionClass() that the
> Collection's constructor needs to be no-arg but there doesn't seem to be
> any
> facility for passing it an argument.
> 
> I could subclass my List and hardcode the argument but that is not
> convenient since I have multiple mappings that use different arguments.
> 
> Thanks in advance for your help,
> 
> Mike
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Using-a-ContainerMapping-with-a-Collection-class-that-does-not-have-a-no-arg-constructor-tp29167061p29173426.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top