Hibernate:No default constructor for entity异常
错误异常:
org.hibernate.InstantiationException: No default constructor for entity: com.tks.skyproject.model.ImplementLogAttach
at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:90)
at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:106)
at org.hibernate.tuple.AbstractEntityTuplizer.instantiate(AbstractEntityTuplizer.java:344)
at org.hibernate.persister.entity.AbstractEntityPersister.instantiate(AbstractEntityPersister.java:3272)
at org.hibernate.impl.SessionImpl.instantiate(SessionImpl.java:1239)
at org.hibernate.impl.SessionImpl.instantiate(SessionImpl.java:1228)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1291)
at org.hibernate.loader.Loader.getRow(Loader.java:1197)
错误分析:构造函数出了问题 到类里一看 默认构造函数被删了
错误解决:
到类里写上:
// 构造无参构造方法
public AbstractUser() {}