Check how to use multi criteria / query for this http://ayende.com/Blog/archive/2007/06/20/Efficently-loading-deep-object-graphs.aspx
On Tue, Nov 25, 2008 at 3:58 PM, Dan Bunea <[EMAIL PROTECTED]> wrote: > Hi, > > We have a 3d scene, like: > > scene -> fixtures -> containers -> garments (all one to many). When > constructing the 3d scene it becomes: > > foreach fixture in scene.Fixtures > foreach container in fixture.Containers > foreach garment in container.Garments > > We might use a fetch and retrieve two levels at a single time, but not 3. > There is an extra complication that containers can be hang or shelf > (joinedkey inheritance). > > Since all the action happens in one session, would it be an improvement if > I preload everything like: > > neededfixtures = "select f from Fixture f inner join f.Scene scene where > scene.Id=? " > neededContainers = "select fc from HanglineContainer fc " + > "inner join fc.Fixture f " + > "inner join f.Scene scene " + > "where scene.Id=? "; > neededContainersShelf="select fc from ShelfContainer fc " + > "inner join fc.Fixture f " + > "inner join f.Scene scene " + > "where scene.Id=? "; > neededGarments = "select g from Garment g " + > "inner join g.FixtureContainer fc " + > "inner join fc.Fixture f " + > "inner join f.Scene scene " + > "where scene.Id=? " > > then > > foreach fixture in scene.Fixtures > foreach container in fixture.Containers > foreach garment in container.Garments > > Doesn't it first check in session if the object is already retrieved? > > > > -- > Dan Bunea > http://www.danbunea.ro > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---