• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Valid HQL but generated SQL is invalid

 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote one error free HQL. Tomcat is up and running without compilation error. but when it got converted into SQL, it gave me some SQL grammar exception. I just changed the order of one join or fields and the problem disappear. I think (I am sure) that HQL was correct.

Did anyone face this kind of issue before? I think this has to do something with the algorithm which converts HQL to SQL. I have faced this issue couple of time in past. Can someone provide me link to that algorithm?

 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vikas Kapoor..

As far as i know the correct HQL would be converted to SQL correct too.., because Hibernate uses/provides Dialects of each Database vendor-specific..
may i know the Database that you use and your HQL?..

please correct me if i'm wrong..

Thanks..
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It'd probably be quicker to post your HQL--I haven't seen very many instances of invalid SQL coming from valid HQL, and certainly not lately.
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I have already corrected the HQL and it was a month ago issue.

If I find that issue again I will post the HQL.

Apart from that can someone point to the link about the algorithm which converts HQL to SQL? Any idea?
reply
    Bookmark Topic Watch Topic
  • New Topic