The Hibernate Criteria Not like, selects the records that don't match to the matching string given in like parameter.
Example:
Criteria criteria=session.createCriteria(Tickit.class); //Here you can pass class on which you want to perform selection
criteria.add(Restrictions.not(Restrictions.like("description", "%Rain%"))); //here you will pass column name and matching string
List list=criteria.list(); //this will return list of selected records
The above code will return only records in which description doesn't contain "Rain" in it's content.
Hope this will help you :)
0 Comment(s)