Hi all,
Is there any way to not use PersistentSet in set mappings ?
My setter method has to iterate over the set, so when Hibernate call the method, an LazyInitializationException is thrown.
The Exception:
12:59:25,832 ERROR [LazyInitializationException] illegal access to loading collection
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)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138)
at java.util.AbstractCollection.addAll(AbstractCollection.java:316)
The method:
Code:
@SuppressWarnings("unused") private void setInterfaceAttributeList(Set<InterfaceAttribute> interfaceAttributeList) {
this.interfaceAttributeList = new LinkedHashSet<InterfaceAttribute>();
if (interfaceAttributeList != null)
this.interfaceAttributeList.addAll(interfaceAttributeList);
}
tks