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 fixed
Date Sun, 19 Jan 2003 11:59:28 GMT
hi all,

ojb now provides better support for extent aware path expression. only 
one sql is executed.
the sql containins one 'outer join' for each extent and one 'or' for 
each criteria:

SELECT DISTINCT A0.KategorieName,A0.Kategorie_Nr,A0.Beschreibung FROM
Kategorien A0
LEFT OUTER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr
LEFT OUTER JOIN BOOKS A1E0 ON A0.Kategorie_Nr=A1E0.Kategorie_Nr
LEFT OUTER JOIN CDS A1E1 ON A0.Kategorie_Nr=A1E1.Kategorie_Nr
A1.Artikelname LIKE  'F%'  OR
A1E0.Artikelname LIKE  'F%'  OR
A1E1.Artikelname LIKE  'F%'

this sql returns all productgroups having an article named 'F%' (article 
has extents Books and CDs). above statement is produced by the following 
simple query:

        Criteria crit = new Criteria();
        crit.addLike("allArticlesInGroup.articleName", "F%");

        Query q = QueryFactory.newQuery(ProductGroup.class, crit, true);
        Iterator iter = broker.getIteratorByQuery(q);

there are some issues with FieldCriteria (criteria referencing another 
field of a class) because the referenced field may also be extent aware.



View raw message