读书人

Hibernate异常:org.hibernate.LazyIni

发布时间: 2013-10-14 12:54:46 作者: rapoo

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

?

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()方法没有问题。

?

?

读书人网 >Access

热点推荐