openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Criteria API; AND 1 = 1 in WHERE Clause
Date Tue, 28 Jun 2011 16:42:01 GMT

   Please post UnternehmenUrv_ and other such *_ classes. I know where is
the 1 = 1 clause is introduced but can not figure out why exactly.
   1.    Join&lt;UnternehmenUrv, Adresse&gt; 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&lt;UnternehmenUrv, Adresse&gt; 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


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message