hql - How to write a query in hibernate for count(*) -
i want execute below query in hibernate?
select count(*) login emailid='something' , password='something'
suppose login
table mapped loginclass
class, emailid
, password
instance variables. you'll execute like:
query query = session.createquery( "select count(*) loginclass login login.emailid=:email , login.password=:password"); query.setstring("email", "something"); query.setstring("password", "password"); long count = (long)query.uniqueresult();
it should return in count
result you're looking for. have adapt name class , parameter names.
Comments
Post a Comment