Initialize EclipseLink at runtime [message #523076] |
Wed, 24 March 2010 15:10  |
Eclipse User |
|
|
|
Hi,
My question is if it is possible to initialize EclipseLink at runtime without making use of hardcopy files (like
persistence.xml or orm.xml). Can the mapping be supplied as an inputstream for example?
--
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
|
|
|
|
|
Re: Initialize EclipseLink at runtime [message #523469 is a reply to message #523268] |
Fri, 26 March 2010 10:01   |
Eclipse User |
|
|
|
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.06259 seconds