-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Changing the path of the persistence.xml
PostPosted: Sat Dec 19, 2009 9:02 am 
Newbie

Joined: Thu Dec 03, 2009 5:36 am
Posts: 4
Location: Ulm - Germany
Hi,
I'm looking for a possibility to replace the path of the persistence.xml, because I need to edit the xml-file with an externally tool without extracting the jar-file.
Could anyone help me?
Thanks!

Benedikt Eberhardinger


Top
 Profile  
 
 Post subject: Re: Changing the path of the persistence.xml
PostPosted: Sat Dec 19, 2009 11:29 pm 
Beginner
Beginner

Joined: Mon Dec 14, 2009 12:26 am
Posts: 23
http://docs.jboss.org/hibernate/stable/ ... ation.html

"The configuration for entity managers both inside an application server and in a standalone application reside in a persistence archive. A persistence archive is a JAR file which must define a persistence.xml file that resides in the META-INF folder. "

"When Persistence.createEntityManagerFactory() is called, the persistence implementation will search your classpath for any META-INF/persistence.xml files using the ClassLoader.getResource("META-INF/persistence.xml") method."

... so you SHOULD, I guess, be able to put a replacement jar earlier in the classpath, and from that persistence.xml config reference your original jar for classes to map.

I haven't tested this myself, though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.