openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phill Moran" <>
Subject Named query created in error
Date Wed, 18 Apr 2007 19:23:06 GMT
Anyone seen this before?

I have the following named query

@NamedQuery(name = "PersonFXStoreAndLogin", query = "SELECT p FROM Person p
WHERE UPPER( = :storeName and UPPER(p.loginName) = :loginName ORDER
BY p.lastName, p.firstName")

That generated the following SQL statement

SELECT, t0.lastUpdated,, t0.activeFrom, t0.activeUntil,
t0.created, t0.displayName, t0.firstName, t0.lastLogin, t0.lastName, t0.locale,
t0.loginName, t0.middleName,, t2.lastUpdated, t2.description,,
t3.lastUpdated, t3.description, t2.value,, t4.lastUpdated, t4.description,
t4.categoryTypeFK, t4.value,, t1.lastUpdated, t1.created, t1.description,
t1.displayName,,, t5.lastUpdated, t5.description,
t5.categoryTypeFK, t5.value, t0.title, t0.visible FROM bidspec.person t0 INNER
JOIN bidspec.manufacturer t1 ON t0.manufacturerFK = LEFT OUTER JOIN
bidspec.category t2 ON t0.roleFK = LEFT OUTER JOIN bidspec.category t4 ON
t0.salutationFK = LEFT OUTER JOIN bidspec.category t5 ON t1.typeFK =
LEFT OUTER JOIN bidspec.categorytype t3 ON t2.categoryTypeFK = WHERE
(UPPER( = ? AND UPPER(t0.loginName) = ?) ORDER BY t0.lastName ASC,
t0.firstName ASC [params=(String) BIDSPEC, (String) PMORAN]

Notice how it is grabbing columns from joined tables. This means it cannot build
the object (Person) I am expecting to get returned and throws an exception. Cool

My guess is that I should not be drilling down with the "UPPER("
which is a field within one of these joined tables (t1).



View raw message