在运行时获取此异常,org.hibernate.UnknownEntityTypeException:无法找到持久性

时间:2020-02-15 06:08:12

标签: java jpa spring-data-jpa

我正在尝试创建用于访问Crud存储库接口的通用接口,我的代码如下

public interface Repository<T extends BaseClass,I> extends CrudRepository<T, I>{

}

Repository<User,Long> repository;
@MappedSuperclass
public class BaseClass {
  @Id
  Long user_id;

  protected BaseClass(){}
}
@Entity
@Table(name="users")
public class User extends  BaseClass{


  private  String user_name;
  private String user_type;
``
this way I am creating repository instance but while starting  the application it is giving exception
Invocation of init method failed; nested exception is org.hibernate.UnknownEntityTypeException: Unable to locate persister xx.xx.BaseClass 

0 个答案:

没有答案
相关问题