are you using an 'old' version of ojb ?
with the current from cvs the following sample works fine:
Criteria crit = new Criteria();
crit.addLike("upper(allArticlesInGroup.articleName)", "F%");
Query q = QueryFactory.newQuery(ProductGroup.class, crit, true);
it even works with extent aware path expressions as you can see.
SELECT DISTINCT A0.KategorieName,A0.Kategorie_Nr,A0.Beschreibung FROM Kategorien A0 INNER 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 WHERE upper(A1.Artikelname) LIKE ? OR upper(A1E0.Artikelname) LIKE ? OR upper(A1E1.Artikelname) LIKE ?
hth
jakob
Juergen Ebert wrote:
Is there a way to do case insensitive queries together with path
expressions?
The following works fine: Criteria crit = new Criteria();
crit.addLike("upper(name)", name.toUpperCase());
But the following gives me a StringIndexOutOfBoundsException:
Criteria crit = new Criteria();
crit.addLike("upper(supplier.name)", name.toUpperCase());
Thanks!
Juergen
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
