Hibernate unknown entity (not missing @Entity or import javax.persistence.Entity )

前端 未结 6 1434
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 13:22

I\'ve got a really simple class:

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.pers         


        
6条回答
  •  暖寄归人
    2020-12-16 13:50

    Do you have any persistence.xml or hibernate.cfg.xml? If you have to add your mapping class in it so hibernate get understand your class is mapping to the database. If you have hibernate.cfg.xml you can add like this

    
    

提交回复
热议问题