I have hibernate partially working but now I ran into a really bizzare issue. Essentially the system is auto-detecting hibernate annotated classes but only classes that are in the same jar as the persistence xml file.
I have two jar files in my web app, each has a foo-persistence.xml file in the /META-INF folder of the jar (named differently in each jar so there's no name conflicts). Also in each of these jar files is a different set of entities. The persistence xml is identical for each. Whichever persistence xml file I use, it will find the annotated hibernate classes in the jar where the persistence xml file lives, but it won't find the annotated entities in the other jar file.
Any ideas???
The persistence xml files are identical and look like this...
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="companyName">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
</persistence-unit>
</persistence>
In my spring config, I have the entity manager configured as follows...
Code:
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation" value="classpath:/META-INF/${spring.project.build.finalName}-persistence.xml"/>
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true"/>
<property name="generateDdl" value="false"/>
<property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect"/>
</bean>
</property>
</bean>