So, Itemgroup has an items relationship that is lazy loaded. Your findItemGroup is only
loading in the Itemgroup entity without doing any fetch joining or eagerly loading of that
relationship, hence your error.
you will need to have another method, "findItemGroupWithItems" or something like
that. In that method you execute a query that does a JOIN FETCH, rather than use find().
Or you can do a find and then (still in findItemGroupWithItems method) immediately force
the loading to happen by calling itemgroup.getItems().size() (this causes a second round
trip to the database - not as efficient but easy to code up).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020733#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...