not like condition in hibernate criteria query

I have a list of tickets. I want all tickets whose status are not like %CLOSED%. Here is an example using Criteria.

[code language=”java”]

Criteria c = super.getSession().createCriteria(Ticket.class);

c.add(Restrictions.not(Restrictions.like("status", "%CLOSED%")));

[/code]

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top