You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by kristen <kr...@yahoo.fr> on 2004/07/26 16:55:10 UTC

re : problem with a request with m:n relations

Thank you for your answer.

And how can I do if I have several M:N relationships ?

For example, I have these relations :

book <--> writtenBy <--> authors <--> belong <--> category

For example, if I would like to obtain the books which belongs to the 
category "Category1" ?

In fact, I don't have a link between book and category and I need to use 
several classes in the "from condition".

Could you help me ?

Thank you




---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: re : problem with a request with m:n relations

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi kristen,

query.create("select books from Books where writtenBy.belong.name = 'Category1'");

assuming the relationships are named writtenBy and belong

hth
jakob

kristen schrieb:
> Thank you for your answer.
> 
> And how can I do if I have several M:N relationships ?
> 
> For example, I have these relations :
> 
> book <--> writtenBy <--> authors <--> belong <--> category
> 
> For example, if I would like to obtain the books which belongs to the 
> category "Category1" ?
> 
> In fact, I don't have a link between book and category and I need to use 
> several classes in the "from condition".
> 
> Could you help me ?
> 
> Thank you
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org