aspose file tools*
The moose likes Object Relational Mapping and the fly likes count(*) and groupby - Projections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "count(*) and groupby - Projections" Watch "count(*) and groupby - Projections" New topic
Author

count(*) and groupby - Projections

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
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?


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: count(*) and groupby - Projections