Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Criteria criteria = session.createCriteria(User.class);
- criteria.add(
- Restrictions.and(
- Restrictions.ilike("firstName", firstName),
- Restrictions.ilike("lastName", lastName)
- )
- );
- def userList = userCriteria.list{
- and{
- if(firstName) {
- like('firstName',firstName)
- }
- if(lastName) {
- like('lastName',lastName)
- }
- }
- }
Add Comment
Please, Sign In to add comment