Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Tim Cooke
Sheriffs:
Rob Spoor
Liutauras Vilda
paul wheaton
Saloon Keepers:
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Piet Souris
Bartenders:
Stephan van Hulst
Forum:
Object Relational Mapping
sql to hql error
Ugender Rekulampally
Ranch Hand
Posts: 135
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I need some help with converting SQL to HQL.
here is the query. (please know that I can't use createSQLQuery on EntityManager)
em.createQuery(""" Select create_date from ( select distinct trunc(create_date) as create_date from CountEntity order by 1 desc )a where rownum <=5 """).getResultList()
Above CountEntity is entity version of Count table.
Right now I am getting this error:
ERROR org.hibernate.hql.PARSER - 18120 line 2:33: unexpected token: (
any suggestions?
Ugender Rekulampally
Ranch Hand
Posts: 135
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I fixed it by using createNativeQuery instead of createQuery on EntityManager.
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
SQL to Hibernate HQL conversion error
unexpected token: group
unexpected token: group
org.hibernate.hql.ast.QuerySyntaxError: unexpected token:
ArgumentException: Encountered "from" at character 1, but expected: ["DELETE", "SELEC
More...