Converting normal sql query into hibernate criteria query -


i need convert sql query hibernate criteria,please guys.

select name, count(*) app
device group name order app desc limit 3

try code:

select device.name, count(device) device device group device.name order count(device) desc 

this assumes have entity class called device field name along getter method getname(). may have change query depending on actual code (which never showed us).

the limit clause had not applicable hql. instead, should doing query.setmaxresults().


Comments

Popular posts from this blog

amazon web services - S3 and apache mod_proxy with basic authentication -

How to install ruby on rails -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -