Hi,
in your BAR class you don't declare a collection for FOO, and a collection for BAR childs?
Joose Vettenranta wrote:
I have like FOO and BAR classes and it's 1:n connection..
There can be lot's of FOO pointing to same BAR id
and BAR has parent id which points to BAR itself
now I would like to fetch something from that tree.. My first idea was this:
in SQL: select * from FOO,BAR where BAR.parent=<id> and BAR.id=FOO.bar_id;
but now that I was writing this, can I some how fetch the subtree from BAR? basicely BAR is a tree where there is 1 root element and then childs and their childs .. etc..
I tried to look at http://db.apache.org/ojb/docu/guides/query.html but couldn't find anything to help me.
of course one option could be to make a recursive function to go through whole tree, maybe it's what I have to do...
Thanks,
Joose
-- "Always remember that you are unique, just like everyone else!" * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 *
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]