Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2.6
Name and version of the database you are using: IBM DB2 8
Server app:: glassfish-v2ur1-b09d
I have one jar file that contains many hbm mappings used by the legacy apps (legacy.jar).
I my EJB app (ejb-app.jar), I want that this mappings be loaded by the hibernate.
So, I write this persistence.xml:
Code:
<persistence-unit name="entityManager" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/dbsm</jta-data-source>
<jar-file>ejb-app.jar</jar-file>
<jar-file>legacy.jar</jar-file>
<properties>
<property name="hibernate.ejb.cfgfile" value="/META-INF/hibernate.cfg.xml"/>
</properties>
</persistence-unit>
The app loads correctly, but the mappings are not readed.
When I do:
Code:
...
entityManager.find(LegacyClass.class, 1L);
...
The hibernate throws:
java.lang.IllegalArgumentException: Unknown entity: LegacyClass
How do I map more than one jar file ?
thanks