2010-06-08 5 views
0

Je voudrais convertir les requêtes suivantes en requête HQL. Comment puis-je faire?Comment faire pour convertir SQL-Query avec sous-sélection dans HQL Query?

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

Cela semble être lié à http://stackoverflow.com/questions/2995427/how-to-solve-following-issue-in-java –

Répondre

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'") devrait fonctionner.

Questions connexes