I know there has been similar questions, but none answers to my problem. I am using JBoss 7.1.1 and Hibernate 2.0, the entities contained in external archives yet reported in the <jar-file> </jar-file>
are not autodetected unless I enter manually one by one these entities between the tag <class> </class>
is my persitence.xml file:
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="alooh-security">
<jta-data-source>java:jboss/datasources/alooh-security</jta-data-source>
<jar-file>alooh-security-model-1.0.0-SNAPSHOT.jar</jar-file>
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/alooh-security"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="123456"/>
<!-- Properties for Hibernate (default provider for JBoss AS) -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.archive.autodetection" value="class, hbm" />
</properties>
</persistence-unit>
</persistence>
No @Entity annotated class in the archive alooh-security-model-1.0.0-SNAPSHOT.jar are detected by JPA. I am obliged to enter manually one by one all entities in alooh-security-model-1.0.0-SNAPSHOT.jar between the tag <class> </ class>
and it's really painful!
Is there a solution?
Thank you