db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Braeuchi" <jbraeu...@gmx.ch>
Subject extent aware pathExpressions broken !
Date Fri, 03 Jan 2003 14:04:07 GMT
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


Mime
View raw message