db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject projectionAttribute (missing test case)
Date Wed, 27 Oct 2004 20:22:56 GMT
hi all,

i'm confused... because i do not know what the projectionAttributes are good for 
  and how they should be used.

i know that Query#setObjectProjectionAttribute changes the search class of a query:

Criteria crit2 = new Criteria();
crit2.addLike("groupName", "B%");
crit2.addLike("upper(articleName)", "F%");

QueryByCriteria q2 = QueryFactory.newQuery(ProductGroup.class, crit2, true);
// set searchclass to Article
q2.setObjectProjectionAttribute("allArticlesInGroup");

Iterator iter2 = broker.getIteratorByQuery(q2);

but i can not make it work with extents :(

first select is ok:
SELECT DISTINCT 
A1.Einzelpreis,A1.Kategorie_Nr,A1.Auslaufartikel,A1.MindestBestand,A1.Lagerbestand,A1.Artikel_Nr,A1.Liefereinheit,A1.BestellteEinheiten,A1.Lieferanten_Nr,A1.Artikelname

FROM Kategorien A0 LEFT OUTER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr 
LEFT OUTER JOIN BOOKS A1E1 ON A0.Kategorie_Nr=A1E1.Kategorie_Nr LEFT OUTER JOIN 
CDS A1E2 ON A0.Kategorie_Nr=A1E2.Kategorie_Nr WHERE (A0.KategorieName LIKE 'B%') 
AND upper(A1.Artikelname) LIKE 'F%'

second select throws SqlException (Column not found: ISBN)
SELECT DISTINCT 
A1.Einzelpreis,A1.Kategorie_Nr,A1.ISBN,A1.AUTHOR,A1.Auslaufartikel,A1.MindestBestand,A1.Lagerbestand,A1.Artikel_Nr,A1.Liefereinheit,A1.BestellteEinheiten,A1.Lieferanten_Nr,A1.Artikelname

FROM Kategorien A0 LEFT OUTER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr 
LEFT OUTER JOIN BOOKS A1E1 ON A0.Kategorie_Nr=A1E1.Kategorie_Nr LEFT OUTER JOIN 
CDS A1E2 ON A0.Kategorie_Nr=A1E2.Kategorie_Nr WHERE (A0.KategorieName LIKE 'B%') 
AND upper(A1.Artikelname) LIKE 'F%'

jakob


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


Mime
View raw message