What's the lazy strategy and how does it work?
I have a problem. I'm learning JPA. I'm using embedded OpenEJB container in unit tests, but only working is @OneToMany(fetch=EAGER) . Otherwise is the collection allways null. I haven't found, how the lazy strategy works, how the container fills the data and in which circumstances triggers the container the loading action? I have read, that the action triggers when the getter is being called. But when I have the code: @OneToMany(fetch = LAZY, mappedBy="someField") private Set<AnotherEntities> entities = new Set<AnotherEntities>(); ... public Set<AnotherEntities> getEntities() { return entities