This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes renaming persistence.xml in JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "renaming persistence.xml in JPA" Watch "renaming persistence.xml in JPA" New topic

renaming persistence.xml in JPA

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
AFAIK Spring provides a mechanism to rename the persistence.xml however I am wondering is this possible with just JPA.
so say, I want to call persistence.xml mypersistence.xml - is this possible?

Note the reason I need to do this is because when deployed in WebSphere, it automatically parses the persistence.xml and I don't want it to. Because I am not using Websphere JPA.
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
JPA requires the file be named persistence.xml,

If you are using EclipseLink, you can set the persistence unit property "eclipselink.persistencexml" to give the path to the file. You can either pass this property in your properties Map, or set it as a system property.

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
I agree. Here's the link:
subject: renaming persistence.xml in JPA
Similar Threads
How to use the JPA in JSF
jpa problems
password and connection's details in persistence.xml
Is it possible to store persistence.xml outside JAR-file?
JPA - What is the use of persistence.xml