我想将以下Query转换为HQL查询。我该怎么办?
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'
答案 0 :(得分:1)
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'")
应该有用。