Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] How to add restrictions dinamically to criteriaBuilder

Hi,

 Im trying to dinamic add restrictions to criteria, but i dont know how to
do it.. all samples in jpa-reference just always add it on
criteriaQuery.where(xxxx,yyy,zzz);

 Can you tell me how to do something like:

 if ( a ) {
  criteriaQuery.addRestriction( qb.equal( X, Y ) );
}

 if ( b ) {
  criteriaQuery.addRestriction( qb.equal( Z, C ) );
}

i wanna to construct my query restrictions in runtime. just adding it when
necessary.

... sry about english.
-- 
View this message in context: http://old.nabble.com/How-to-add-restrictions-dinamically-to-criteriaBuilder-tp26927045p26927045.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top