• Post Reply Bookmark Topic Watch Topic
  • New Topic

problems with Hibernate request

 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I guess it's MySQL who is guilty in this problem :-(
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!