Hi,
Please post UnternehmenUrv_ and other such *_ classes. I know where is
the 1 = 1 clause is introduced but can not figure out why exactly.
Nits:
1. Join<UnternehmenUrv, Adresse> adresseJoin = untRoot.join(
UnternehmenUrv_.adressen.getName(), JoinType.INNER);
A simpler (and slightly more effective) form would be to get rid of
.getName(). Actually by calling getName(), the code is loosing type-safety
and OpenJPA is working twice to restore it !
Join<UnternehmenUrv, Adresse> adresseJoin = untRoot.join(
UnternehmenUrv_.adressen, JoinType.INNER);
2. cq.where(cb.and(predicates.toArray(new Predicate[0])));
A better form would be (would save JVM to instantiate an extra array
unnecessarily)
cq.where(cb.and(predicates.toArray(new
Predicate[predicates.size()])));
-----
Pinaki
--
View this message in context:
http://openjpa.208410.n2.nabble.com/Criteria-API-AND-1-1-in-WHERE-Clause-tp6373899p6525633.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.