1
//$Id: RowCountProjection.java 9908 2006-05-08 20:59:20Z max.andersen@jboss.com $
2
package org.hibernate.criterion;
4
import org.hibernate.Criteria;
5
import org.hibernate.Hibernate;
6
import org.hibernate.HibernateException;
7
import org.hibernate.type.Type;
13
public class RowCountProjection extends SimpleProjection {
15
protected RowCountProjection() {}
17
public String toString() {
21
public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
22
throws HibernateException {
23
return new Type[] { Hibernate.INTEGER };
26
public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
27
throws HibernateException {
28
return new StringBuffer()
29
.append("count(*) as y")