Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

count(*) and groupby - Projections

 
JayaSiji Gopal
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic