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

前端 未结 6 1432
隐瞒了意图╮
隐瞒了意图╮ 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:34

    You should use AnnotationConfiguration instead of Configuration and then call

    configuration.addAnnotatedClass(User.class);
    

    to add your class to the list of mapped classes.

提交回复
热议问题