|
|
Re: Initialize EclipseLink at runtime [message #523268 is a reply to message #523076] |
Thu, 25 March 2010 17:39 |
|
Using the JPA Persistence class, you need to have a persistence.xml.
You could call the EclipseLink PersistenceProvider class directly, or create the EclipseLink EntityManagerFactoryImpl directly.
You would still need some way to define your persistence info and mappings. You could create your EclipseLink ServerSession and ClassDescriptor and DatabaseMappings directly through code, or use the MetadataProcessor to parse your annotations if you have that.
Why can't you have a file? Where is your mapping info coming from?
James : Wiki : Book : Blog : Twitter
|
|
|
Re: Initialize EclipseLink at runtime [message #523469 is a reply to message #523268] |
Fri, 26 March 2010 14:01 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Thanks, I am generating the orm mapping at runtime therefore it is far more handier to not have it in a file somewhere.
The easiest would be if there is an api which just gets an inputstream or string which I can use. Does such an api exist
(this is what the MetaDataProcessor can do, correct?)?
Btw, I could not find the MetadataProcessor class (I am using Helios), where is it located?
I still would need a persistence.xml file somewhere? Or is there a way to also do that part programmatically?
gr. Martin
James wrote:
> Using the JPA Persistence class, you need to have a persistence.xml.
>
> You could call the EclipseLink PersistenceProvider class directly, or
> create the EclipseLink EntityManagerFactoryImpl directly.
>
> You would still need some way to define your persistence info and
> mappings. You could create your EclipseLink ServerSession and
> ClassDescriptor and DatabaseMappings directly through code, or use the
> MetadataProcessor to parse your annotations if you have that.
>
> Why can't you have a file? Where is your mapping info coming from?
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
|
Powered by
FUDForum. Page generated in 0.03555 seconds