[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: Unknown entity type - addl details

Thomas Haskes пишет:
Did you try listing your entity classes in persistence xml?

see my persistence.xml in first message, it contain <class>javaapplication8.DiscountCode</class>


I tried also to add <exclude-unlisted-classes> and still no success.
Wonder if it's an issue in eclipselink 2.0 m6, may be usage of jpa 2.0 javax (from eclipselink bundle) affect this too.



To do that you need to add a "class" child to your persistnce xml before the <properties> child like this.

<persistence-unit name="some_pu" transaction-type="RESOURCE_LOCAL">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

		<class>org.package.[...].DiscountCode</class>
		<class>org.package.SomeOtherClass</class>
		<properties>
			<property name="eclipselink.jdbc.driver" 				
value="oracle.jdbc.driver.OracleDriver" />
		[...]

I remember that when I switched to EL from Hibernate that I had to list
my classes as EL whas complaining about not knowing my entites. That
helped. EL seems to be more strict concerning unlisted entites as other
ORM's.

Later,

Tom

Serge schrieb:
 - javax.persisten.jar is for jpa 2.0

 - if I replace eclipselink with either toplink or hibernate(not sure
with version) all works. i.e. add toplink/hibernate libraries and
replace provider/properties in persistence.xml.