db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Braeuchi" <jbraeu...@gmx.ch>
Subject Re: extent aware pathExpressions broken !
Date Fri, 03 Jan 2003 14:15:30 GMT
hi,

the query i'm thinking of is the following:

SELECT DISTINCT A0.KategorieName,A0.Kategorie_Nr,A0.Beschreibung
FROM
Kategorien A0
INNER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr
INNER JOIN BOOKS A2 ON A0.Kategorie_Nr=A2.Kategorie_Nr
INNER JOIN CDS A3 ON A0.Kategorie_Nr=A3.Kategorie_Nr
WHERE
A1.Kategorie_Nr = 5
or A2.Kategorie_Nr = 5
or A3.Kategorie_Nr = 5

and it seems to work (at least in hsqldb, mysql and sapdb)
so the only problem i have is how to build this sql ....
any ideas or help will be appreciated.

jakob

----- Original Message -----
From: "Jakob Braeuchi" <jbraeuchi@gmx.ch>
To: "OJB Developers List" <ojb-dev@jakarta.apache.org>
Cc: "OJB Users List" <ojb-user@jakarta.apache.org>
Sent: Friday, January 03, 2003 3:04 PM
Subject: extent aware pathExpressions broken !


> hi all,
>
> while playing aoround with extent aware path expressions, i found that the
> current implementation does not work due to caching of sql statements.
>
> i queried for the query i did is :
>
> crit.addEqualTo("allArticlesInGroup.productGroupId", new Integer(5));
> Query q = QueryFactory.newQuery(ProductGroup.class, crit, true);
>
> because 'allArticlesInGroup' points to a class with two extents  the 3
> following queries should have been executed (one for Artikel, Books and
CDs)
>
> SELECT DISTINCT A0.KategorieName,A0.Kategorie_Nr,A0.Beschreibung FROM
> Kategorien A0 INNER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr
WHERE
> A1.Kategorie_Nr = '5'
>
> SELECT DISTINCT A0.KategorieName,A0.Kategorie_Nr,A0.Beschreibung FROM
> Kategorien A0 INNER JOIN Books A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE
> A1.Kategorie_Nr = '5'
>
> SELECT DISTINCT A0.KategorieName,A0.Kategorie_Nr,A0.Beschreibung FROM
> Kategorien A0 INNER JOIN CDS A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE
> A1.Kategorie_Nr = '5'
>
> due to caching of the statement (and manipulation of the original, cached
> query) the 'Artikel' query is executed 3 times.
>
> imo we should look for a better way to support exent aware
pathExpressions.
> even if the above mentioned way would work as expected we would have read
> the same productGroup 3 times although there's only one with id = 5 !.
>
> i'm thinking of a solution where we need only ONE sql including all tables
> of the extents.
>
> any ideas ?
>
> jakob
>
>
> --
> To unsubscribe, e-mail:   <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ojb-dev-help@jakarta.apache.org>
>


Mime
View raw message