1 package org.hibernate.criterion; 3 4 import org.hibernate.Criteria; 5 import org.hibernate.HibernateException; 6 import org.hibernate.type.Type; 7 8 11 public class Distinct implements Projection { 12 13 private final Projection projection; 14 15 public Distinct(Projection proj) { 16 this.projection = proj; 17 } 18 19 public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery) 20 throws HibernateException { 21 return "distinct " + projection.toSqlString(criteria, position, criteriaQuery); 22 } 23 24 public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery) 25 throws HibernateException { 26 return projection.toGroupSqlString(criteria, criteriaQuery); 27 } 28 29 public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) 30 throws HibernateException { 31 return projection.getTypes(criteria, criteriaQuery); 32 } 33 34 public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery) 35 throws HibernateException { 36 return projection.getTypes(alias, criteria, criteriaQuery); 37 } 38 39 public String [] getColumnAliases(int loc) { 40 return projection.getColumnAliases(loc); 41 } 42 43 public String [] getColumnAliases(String alias, int loc) { 44 return projection.getColumnAliases(alias, loc); 45 } 46 47 public String [] getAliases() { 48 return projection.getAliases(); 49 } 50 51 public boolean isGrouped() { 52 return projection.isGrouped(); 53 } 54 55 public String toString() { 56 return "distinct " + projection.toString(); 57 } 58 } 59 | Popular Tags |