]
Emmanuel Bernard resolved EJB-295.
----------------------------------
Resolution: Rejected
use META-INF/myorm.xml not /META-INF/myorm.xml
mapping-file orm.xml not included
---------------------------------
Key: EJB-295
URL:
http://opensource.atlassian.com/projects/hibernate/browse/EJB-295
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Environment: Hibernate Core 3.2.4.GA
Hibernate EntityManager 3.3.1.GA
Reporter: Georges-Etienne Legendre
Priority: Minor
Attachments: testcase.zip
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 works, we have to
add these 2 lines in the persistence.xml :
<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: "... 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."
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: