• Post Reply Bookmark Topic Watch Topic
  • New Topic

count(*) and groupby - Projections  RSS feed

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a query



I am trying to use Hibernate detached criteria and have the following code:



This generates the above query with count(*). What should i add to get the count(*) in the query?
I tried projectionsCriteria.setProjection(Projections.count("column1")); and
projectionsCriteria.setProjection(Projections.rowCount());

that does not work. Any ideas?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!