Javatpoint Logo

Exception in thread "main" org.hibernate.MappingException: Unknown entity:

By: sammai*** On: Wed Jul 29 15:01:09 IST 2015     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
I got error saying Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.demo.annotation.test.Employee

I am sure that in my configuration file am using <mapping class="com.demo.annotation.test.Employee"/> and table name is "test".Even though i got error.Please help me how to resolve.
Up0Down

 
You entity is not correctly annotated, you must use the @javax.persistence.Entity annotation. You can use the Hibernate extension @org.hibernate.annotations.Entity to go beyond what JPA has to offer but the Hibernate annotation is not a replacement, it's a complement.Image Created0Down

By: [email protected] On: Wed Jul 29 15:15:27 IST 2015 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No