-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Overriding Mapping of Child Collection
PostPosted: Wed Sep 16, 2009 2:15 pm 
Newbie

Joined: Tue Jul 26, 2005 10:25 am
Posts: 12
Hibernate Verstion: 3.3.2.GA

I have an Organization class, containing a @ManyToOne mapping with parent and a @OneToMany with its children (pretty standard).

However, in order to improve performance, I've added nested set fields to the Organization objects. Now, theoretically, to load child Organization's, I just need to get everything between the Left and Right fields (hql query would like like this: "from Organization o where o.nsLeft > :left and o.nsRight < :right" (and obviously, set the left and right parameters to the paren'ts left and right).

My Nested Set implementation is only partially complete, a load of a single organization still causes the initialization of its children (recursively). I'd like to override the initialization to use the nsLeft and nsRight fields, but am unsure of how to proceed.

Any help out there?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.