openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Nozicka <georg.nozi...@nozicka.at>
Subject Criteria API; AND 1 = 1 in WHERE Clause
Date Tue, 17 May 2011 17:02:07 GMT
Hello, 

we are using OPENJPA 2.0.0 and have defined with the criteria api a query
which produces the following sql code (actually the sql uses more columns, I
tried to remove some of them to make the sql easier to read):

SELECT T0.OID, T0.X, T3.BEZOID, T3.OID, T3.GEMNR 
FROM TABLE0 T0 
INNER JOIN TABLE1 T1 ON T0.OID = T1.UOID 
INNER JOIN TABLE2 T2 ON T0.OID = T2.BEZOID 
LEFT OUTER JOIN TABLE2 T3 ON T0.OID = T3.BEZOID 
WHERE (T1.Y LIKE ? ESCAPE '\' AND T2.GEMNR LIKE ? ESCAPE '\' AND 1 = 1) 

[params=(String) abc%, (String) 801%]

The questions are
- why is at the end “AND 1 = 1” appended?
- is it possible to avoid somehow the "AND 1 = 1" and if, how?

Best Regards,
Georg


--
View this message in context: http://openjpa.208410.n2.nabble.com/Criteria-API-AND-1-1-in-WHERE-Clause-tp6373899p6373899.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message