Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » eclipselink programmatically generate persistentunit
eclipselink programmatically generate persistentunit [message #870643] Wed, 09 May 2012 03:50 Go to next message
abdullah ilhanlı is currently offline abdullah ilhanlı
Messages: 2
Registered: May 2012
Junior Member
I have one problem when i tried to generate persistent unit programmatically.
I have two system. These are Configuration Manager(CM) and Business Managemer(BM).
They run on the different context. In BM I used eclipselink for data layer.
You can define database and its user on the CM for BM sign in.
When you define database and its users on the CM, BM didnt know this database and its user. Because on the BM JPA persistence.xml is predefined.
I don't know how many database created on the system.
I need generate persistence unit programmatically.

Is it possible any ideas?
Is it possible with hibernate?
Is it possible run JPA without persistence.xml ?

Thanks in advance

[Updated on: Wed, 09 May 2012 03:56]

Report message to a moderator

Re: eclipselink programmatically generate persistentunit [message #871022 is a reply to message #870643] Thu, 10 May 2012 10:41 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can pass persistence unit properties when creating an EntityManagerFactory to change the database and user.

http://www.eclipse.org/eclipselink/api/2.3/org/eclipse/persistence/config/PersistenceUnitProperties.html


James : Wiki : Book : Blog : Twitter
Previous Topic:use of a literal for EXISTS expressions
Next Topic:Using EclipseLink in OSGi with Gemini JPA. Two questions.
Goto Forum:
  


Current Time: Fri Jul 25 15:59:57 EDT 2014

Powered by FUDForum. Page generated in 0.02275 seconds