Of course if I put that it's not auto-fetched. But how can I command it to fetch collection from object?

Collection col = bean.getCollection()

... then what?

- Joose

21.8.2004 kello 10:08, Joose Vettenranta kirjoitti:

No, I don't... I could do it, but then I have a problem,

how do I prevent it to load all of that info when fetching one?

if I have BAR is like tree and FOO is just a list where 1 entry belongs to one node. So if I have collection on auto-fetch and reference as auto-fetch, then what ever I fetch from BAR or FOO, every entry in BAR and FOO is fetched. Right?

- Joose

20.8.2004 kello 15:12, Cl�vis Wichoski kirjoitti:

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]


--
"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]


--
"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]



Reply via email to