Error performing load command : org.hibernate.InstantiationException: No default constructor for entity: : entity.User
【原因】

The no-argument constructor, which is also a JavaBean convention, is a requirement for all persistent classes. Hibernate needs to create objects for you, using Java Reflection.

所有持久化类必须要求有不带参的构造方法(也是JavaBean的规范)。Hibernate需要使用Java反射为你创建对象。
——来自官方文档《Hibernate Getting Started Guide》

【解决方法】

当实体类声明了其他带参构造方法时,需要显式声明不带参构造方法。

 

相关文章:

  • 2021-04-28
  • 2021-09-25
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-10-19
  • 2021-08-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-04-14
  • 2021-08-04
  • 2021-10-08
  • 2022-12-23
相关资源
相似解决方案