Reputation: 1842
When I execute like query on oracle on number datatype , it works fine i.e
select * from customer c where c.customer_number like '%400%'
Here customer_number is of 'number' datatype in oracle.I have to execute same query from hibernate but in my POJO this customer_number maps to a Long type. I am able to do this by HQL i.e
from Customer c where c.customerNumber like %400%
How can I do it with criteria query? Thanks in advance
Upvotes: 1
Views: 1507
Reputation: 4043
criteria.add(Restrictions.like('c.customerNumber', '400', MatchMode.ANYWHERE));
Upvotes: 1