조회를 실행하는 중 오류가 발생했습니다.자바에서 다음 문제를 해결하는 방법은 무엇입니까?
org.hibernate.hql.ast.QuerySyntaxException: expecting CLOSE, found 'LIMIT' near line 1, column 194 [from com.claystone.db.Gpsdata where id.mobileunitid = '2090818044' and gpsdate in (select id.gpsdate from com.claystone.db.Gpsdata where id.mobileunitid = '2090818044' ORDER BY id.gpsdate DESC LIMIT 1) and gpsstatus='true']
이것은 내 검색어입니다.이 검색어의 실수는 무엇입니까?
data=session.createQuery[from com.claystone.db.Gpsdata where id.mobileunitid = '2090818044' and gpsdate in (select id.gpsdate from com.claystone.db.Gpsdata where id.mobileunitid = '2090818044' ORDER BY id.gpsdate DESC LIMIT 1) and gpsstatus='true']
HQL이 LIMIT 키워드를 지원하지 않는다고 생각합니다. 쿼리를 다시 작성할 수 없다면 네이티브 쿼리를 사용할 수 있습니다. 옵션. :(. 나는 다른 대답에 대해 궁금합니다. – Bogdan
@Bogdan - 관련 질문으로 연결됩니다 : http://stackoverflow.com/questions/1239723/how-do-you-do-a-limit-query -in-hql –