Maksimenko Alexander wrote:
I have tree like structure (with parent,children relationships). I'm using proxies to lazy materialize them. Everything works well but in particular cases I have to materialize the whole tree because folder.getChildren().get(0).getParent() is not the same as folder and sometimes it makes the problem. How can I tell OJB to prefetch references "parent" and "children" for all folders? Or is there simpler way to do this?

I am not sure I understand your question correctly, but it sounds like you (possibly among other things) are interested in getting a deterministic order on your Collection references?

If that is the case, have a look at the orderby and sort attributes
of collection-descriptor [1].


If your problem is that from child=>parent you don't get the 1:1 mapping you would like, could you please tell us the details of your repository file?

I guess from your text that you want:
 a) for parent class, to map children with collection-descriptor and inverse FK
 b) for child class, to map parent with reference-descriptor and FK

On a, ie parent=>child and Collection, you might want to use an ordered 
collection
as collection class and set orderby and sort attributes in order to get
deterministic ordering of the collection (if not, you will get RDBMS ordering =
random and likely to change on insert/update/delete on the table even if you
use an ordered Java collection as collection-class).


Please get back with more details if I didn't understand your question.

Regards,
 Martin

[1] 
http://db.apache.org/ojb/docu/guides/repository.html#collection-descriptor-N10611


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to