• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

problems with Hibernate request

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have problem with the following request.
In SQL I can use the following query:



And this works perfectly well -- giving me all what I need and correct amount of sub. records for each record, and it perfectly sort everything by amount of sub.records.

I really cannot create same request with Hibernate. All the time it give me an error.
This is how I am doing that



Always give me an error - Invalid use of group function.

I am not sure what I am doing wrong, because in Hibernate's
manual there is an example which looks like my query. But they pretend it is working...


Where could be my problem?

Thanks!
[ June 28, 2005: Message edited by: Olexiy Prokhorenko ]
 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess it's MySQL who is guilty in this problem :-(
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Olexiy Prokhorenko:




You are grouping by a table. Try grouping by a column, something like: "group by r.recId"

HTH
 
reply
    Bookmark Topic Watch Topic
  • New Topic