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() {... } 方法調(diào)用了set對象成員的hashCode()方法
如this.getSets().hashCode();
刪除該方法的調(diào)用即可;調(diào)用非set對象成員的.hashCode()方法沒有問題。