I have written few codes for inserting data into my SQL database. Actually, I am trying to learn Struts2 with Hibernate. But, unfortunately I am facing a problem after submi
If the entity isn't mapped, you should inspect the hibernate configuration. Hibernate is ORM framework used to map pojos (entities) to the database schema objects. You didn't configure or hibernate couldn't find mapping for the object Employee
. The configuration file is hibernate.cfg.xml
should contain the mapping to the resource Employee.hbm.xml
. Suppose this file is in the same folder as Employee
class. Then the mapping will be
<mapping resource="v/esoft/pojos/Employee.hbm.xml"/>
Another approach if you used an annotation based configuration, then you should use class
attribute to map to the pojo that contains Hibernate/JPA annotations.
<mapping class="v.esoft.pojos.Employee"/>
Note, annotation based Configuration
might be different depending on version of Hibernate and may require additional libraries.