• 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
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

hibernate SQLGrammarException

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my mapping XML I have


When I write a hql query like:
I get exception :
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)

Could someone please help me with this? If I don't use aggregate function min() then I get valid data with the rest of the query kept same but retrieving other column (Other than subscriberID) values from Subscriber table like say subscriberName.
So I guess it is a problem with generator class="sequence"

The project is already in production and I cannot change the mappings just for the enhancement issue I am working on. So could you suggest some solution?
Thanks.

[ October 21, 2008: Message edited by: Amit kull ]

[ October 21, 2008: Message edited by: Amit kull ]
[ October 21, 2008: Message edited by: Amit kull ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


So I guess it is a problem with generator class="sequence"


This is unlikely. The generation strategy is not going to matter when you are querying - no key generation is taking place after all.

What is more likely is the misplaced comma after Subscribers.
 
Amit kull
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Paul.
But the comma is not there in actual code. I just made typo while posting the topic here.
I will now edit the query. Meanwhile let me know any other probable causes of this exception.
Thanks, again.
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic