hi all,
Im new to Hibernate .
Im using Hibernate 3
Server : JBoss 4.0.2
This is my sql
select userid,password,startdate,enddate,(select count(sessionid)+1 from tsession where ltrim(rtrim(userid))= '"+username.trim()+"') as sessioncount,wipuserid from users where ltrim(rtrim(userid)) ='"+username.trim()+"' and ltrim(rtrim(password))='"+password.trim()+"'
This query woks fine.
In this i have a SubQuery
select count(sessionid)+1 from tsession where ltrim(rtrim(userid))= '"+username.trim()+"'
without giving this subquery i have written in HQL below
Query query = session.createQuery("from loginBean where userid =:user and password=:pass");
in this i have to give my subquery how to give that.
thanx in advance
selva
|