I have the follwoing entity
@Entity
@Table(name = "Parent")
public class Parent {
@ElementCollecion(fetch = FetchType.Eager)
Map<Integer,String> myMap;
public Map<Integer,String> getMyMap() {
return this.myMap;
}
}
Then somewhere in the code I have the follwoing
parent.getMyMap().get(someKey);
This line consistently throws a LazyInitialization exception. I have set the fetchType to eagerly load the collection so that the values are available at all times. What have I missed> Is it because of the access of the getMap.GetKey call?
I dont see any more information in the debug logs or anywhere else.