Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • NOT LIKE in Hibernate Criteria

    • 0
    • 1
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 3.53k
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: