HIbernate query

Posted by sarah on Stack Overflow See other posts from Stack Overflow or by sarah
Published on 2010-04-20T07:13:22Z Indexed on 2010/04/20 7:23 UTC
Read the original article Hit count: 281

Filed under:
|

Hi

I want to execute a query using hibernate where the requirment is like

select * from user where regionname=''

that is select all the users from user where region name is some data How to write this in hibernate The below code is giving result appropraitely

Criteria crit= HibernateUtil.getSession().createCriteria(User.class);
        crit.add(Restrictions.eq("regionName", regionName));

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate