`

Hibernate错误:org.hibernate.LazyInitializationException: illegal access to loading

    博客分类:
  • Java
 
阅读更多

 

org.hibernate.LazyInitializationException: illegal access to loading collection
  at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341)
  at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)


原因在于pojo里面的   public int hashCode() {... } 方法调用了set对象成员的hashCode()方法
如this.getSets().hashCode();
删除该方法的调用即可;调用非set对象成员的.hashCode()方法没有问题。

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics