in that case you can only use the ForeignAdress table. TO make OJB do
that you must supply a path expression hint.
something like :
<java>
Criteria crit = new Criteria();
crit.addEqualTo("addresses.coutry","BRASIL");
QueryByCriteria query = new QueryByCriteria(Person.class,crit);
query.addPathClass("addresses",ForeignAddress.class);
Collection result = broker.getCollectionByQuery(query);
</java>
On Wed, 2002-11-06 at 10:59, [EMAIL PROTECTED] wrote:
> Here is a short example:
>
> The class person has many adresses (class Adress). The class ForeignAdress
> extens Adress and has the additional member country.
> Now I want to query all persons in Spain. OJB generates a query which look
> for the country-column in the adress-table which comes to
> a SQLException.
>
> How could I generate a query like this?
> Tanks
> Andy
>
>
> --
> To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>
>
>
--
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)
http://www.ibnetwork.com.br
http://jakarta.apache.org/ojb
--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>