Strange behavior in loading entities [message #632039] |
Mon, 11 October 2010 06:20  |
Eclipse User |
|
|
|
I am working on a project to migrate from Hibernate to EclipseLink 2.1.1.
I list all my entities in the persistence.xml using <class> tags. However, when I use entityManagerFactory.getMetamodel.getEntities(). Nothing is returned.
But the weird thing is: when I remove all the <class> tags, I can get Entity3 from the getEntities() method but not all.
It would be greatly appreciated if someone has a hint for this problem.
I am using Spring 3.0.3, EclipseLink 2.1.1.
persistence.xml:
<persistence-unit name="mainPU" transaction-type="RESOURCE_LOCAL">
<class>foo.bar.Entity1</class>
<class>foo.bar.Entity2</class>
<class>foo.bar.Entity3</class>
<class>foo.bar.Entity4</class>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<validation-mode>NONE</validation-mode>
</persistence-unit>
spring bean in xml:
<bean id="mainEmf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation" value="classpath:config/persistence.xml" />
<property name="persistenceUnitName" value="mainPU"/>
<property name="persistenceProviderClass" value="org.eclipse.persistence.jpa.PersistenceProvider" />
<property name="jpaProperties">
<props>
<prop key="javax.persistence.jdbc.driver">net.sourceforge.jtds.jdbc.Driver</prop>
<prop key="javax.persistence.jdbc.url">jdbc:jtds:sybase://someURL</prop>
<prop key="javax.persistence.jdbc.user">xxxx</prop>
<prop key="javax.persistence.jdbc.password">xxxx</prop>
<prop key="eclipselink.weaving">false</prop>
</props>
</property>
</bean>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07641 seconds