tags:

views:

16

answers:

1

I would like to convert following Query into HQL Query. How can i do?

select * from gpsdata where mobileunitid = '2090818044' and gpsdate in (select gpsdate from gpsdata where mobileunitid = '2090818044' ORDER BY gpsdate DESC LIMIT 1 ) and gpsstatus='true'

+1  A: 

Query q = session.createQuery("from GpsData where mobileUnitId = '2090818044' and gpsDate in (select gpsDate from GpsData where mobileUnitId = '2090818044' ORDER BY gpsDate DESC LIMIT 1 ) and gpsStatus='true'") should work.

Adeel Ansari