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?
|