-->
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.  [ 1 post ] 
Author Message
 Post subject: mapping-file orm.xml not included
PostPosted: Tue Jun 05, 2007 1:28 pm 
Newbie

Joined: Tue Jun 05, 2007 12:02 pm
Posts: 1
We have the following situation:

A jar library for our entity classes has been created. In it, there are these two files in the META-INF directory: persistence.xml and orm.xml. We define some common queries in the orm.xml file.

This library is then used in another project. Because we would like to define other more specialized named queries in this project, we assumed that another orm.xml file (in the META-INF directoty) could be used. Without any workaround, it doesn't work. The entity manager only find/use the orm.xml contained in the library. To make it work, we have to add these 2 lines in the persistence.xml :

Code:
<mapping-file>/META-INF/orm.xml</mapping-file>
<mapping-file>/META-INF/orm.xml</mapping-file>

The entity manager then includes both orm.xml files.

In JSR 220, chapter 6.2.1.6, it's said:

Quote:
... A object/relational mapping XML file named orm.xml may be specified in the META-INF directory in the root of the persistence unit or in the META-INF directory of any jar file referenced by the persistence. xml. Alternatively, or in addition, other mapping files may be referenced by the mapping-file elements of the persistence-unit element, and may be present anywhere on the class path.

It looks like a bug, isn't it?

Hibernate version:
* Hibernate Core 3.2.4.GA
* Hibernate EntityManager 3.3.1.GA[/code]


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

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.