My persistence.xml
looks like:
<persistence>
<persistence-unit name="test">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.XXX.Abc</class>
<properties>
<property name="hibernate.archive.autodetection" value="true" />
..
</properties>
</persistence-unit>
<persistence>
Everything works fine. When I'm removing <class>
directive I'm getting an exception from EntityManager.find(Abc.class, 1)
:
java.lang.IllegalArgumentException: Unknown entity: com.XXX.Abc
Looks like hibernate can't discover my annotated classes although I'm using @Entity
.. Why?