On Tue, Dec 27, 2011 at 4:27 AM, Boblitz John <john.bobl...@bertschi.com>wrote:
> Is your persistent context still active? > Yep. The operations are pretty much after each other. TypedQuery<E_Category> q2 = em.createNamedQuery(Q.LIST_CATS, E_Category.class); for (E_Category db : q2.getResultList()) { appList.categories.add(new Category(db, true)); } Inside the 'new Category()', I access entity.apps, which is: public class E_Category { ... @ManyToMany(fetch = FetchType.LAZY, mappedBy = "categories") public Collection<E_App> apps; ... } Mapping in the other direction is also LAZY. Thanks, Pawel. > -----Ursprüngliche Nachricht----- > > Von: Pawel Veselov [mailto:pawel.vese...@gmail.com] > > Gesendet: Dienstag, 27. Dezember 2011 12:03 > > An: users@openjpa.apache.org > > Betreff: Lazy many-to-many properties don't load on demand? (2.1.1) > > > > Hi. > > > > I'm using 2.2.1 > > > > I have declared a ManyToMany property, with lazy fetch type > > (my entities are all property based). > > The property does not load when accessed (the collection is null). > > Setting it to eager loading works, but I don't want (for performance > > reasons) for it to always load. > > > > Is there something I may be missing? > > > > Thank you, > > Pawel. > > >