0

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'

lakshmi
  • 4,539
  • 17
  • 47
  • 55

1 Answers1

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'");

, should work.

Adeel Ansari
  • 39,541
  • 12
  • 93
  • 133