If you hit an exception as “Unknown Entity” with Java Hibernate as below:
org.hibernate.MappingException: Unknown entity: com.myapplication.mymodel.modelname.ModalClass
It means the Class is not added into Hibernate configuration and to solve it simply you would need to add the class into your hibernate.cfg.xml as below:
- <mapping class=”com.myapplication.mymodel.modelname.ModalClass” />
You can find more details at StackOverflow.
Keywords: Java, Hibernate, Class, Unknown Entity, Exception