This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Create Entity Manager Factory without persistence.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Create Entity Manager Factory without persistence.xml" Watch "Create Entity Manager Factory without persistence.xml" New topic
Author

Create Entity Manager Factory without persistence.xml

Gaurav Gupta Ser
Greenhorn

Joined: Dec 22, 2012
Posts: 6
Is there a way to create the EntityManagerFactory without a persistence unit defined? Can you give all the required properties to create an entity manager factory? I need to create the EntityManagerFactory from the user's specified values at runtime. Updating the persistence.xml and recompiling is not an option.

Currently I am using eclipselink dynamic persistence so i need to create the EntityManagerFactory without a persistence unit defined ? I have groups of runtime entities that need to map single group of entities to different database in runtime and no persistence unit entry is available for this runtime group of entities .

Any idea on how to do this is more than welcomed!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create Entity Manager Factory without persistence.xml
 
Similar Threads
injecting @PersitenceContext
Multiple persistance unit simultaneously, issue.
Connection to data source on the basis of userlogin using JPA
Persitence confusion. Please help.
Store multiple persistence units in one entity manager factory?