Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Create persistence unit programmically without persistence.xml

I suppose that is the main reason you need a persistence.xml, to define the
set of classes/classpath.  I don't think it is possible to deploy JPA
without a persistence.xml.  You could log an enhancement to allow passing
the class list, or orm.xml file with the persistence properties Map, but you
would still need to access the EclipseLink provider directly as JPA
Persistence requires a persistence.xml to know the provider.

You can create an EntityManagerFactory using an EclipseLink ServerSession,
but then you would need to build the EclipseLink ClassDescriptors yourself
or using the Mapping Workbench.  You could also try to use the
MetadataProcessor directly yourself to process a set of annotations or
orm.xml.



philk wrote:
> 
> Hello,
> 
> I want to create a persistence unit with out using the persistence.xml. I
> am
> already feeding EL all the "eclipselink" properties for the database
> connection and the class loader. The last thing I struggle to find is, how
> to feed EL the entity classes that the PU should be aware of. How would I
> do
> that?
> 
> Thanks,
> Phil
> 
> 


-----
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://www.nabble.com/Create-persistence-unit-programmically-without-persistence.xml-tp24409363p24481294.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top