• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Persistence Unit reference JAR/WAR/EAR  RSS feed

 
Greenhorn
Posts: 26
Firefox Browser Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I was reading the JPA specification and there is something I can't understand (8.2.1.6.3 examples ).
We have a lot of example of how to point to a jar file containing entities.


Example 5:
app.ear
war2.war
WEB-INF/lib/warEntities.jar WEB-INF/classes/META-INF/persistence.xml
persistence.xml contains: <jar-file>lib/warEntities.jar</jar-file>



I think I am wrong but persistence.xml should contain : <jar-file>../lib/warEntities.jar</jar-file> ?

Could you please give me a piece of advice on that purpose ?

In the same way if we look at :


Example 7:
app.ear
lib/earEntities.jar
war1.war
WEB-INF/lib/warPUnit.jar (with META-INF/persistence.xml )
persistence.xml contains: <jar-file>../../../lib/earEntities.jar</jar-file>


I think it should contain <jar-file>../../lib/earEntities.jar</jar-file>
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's important to know what the persistence unit root is. The persistence unit root is the JAR or directory that contains the META-INF directory where the persistence.xml file is located.

So I'm with you on both examples: I think it needs to be ../lib/warEntities.jar for the first and in the second example, in which the JAR is the root, I believe it needs to be ../../lib/earEntities.jar

Can anyone shed a light on this please?
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!