• Post Reply Bookmark Topic Watch Topic
  • New Topic

Valid HQL but generated SQL is invalid  RSS feed

 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • 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?

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • 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..
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!