FileDocCategorySizeDatePackage
SQLProjection.javaAPI DocHibernate 3.2.51933Sat Feb 12 00:19:50 GMT 2005org.hibernate.criterion

SQLProjection

public class SQLProjection extends Object implements Projection
A SQL fragment. The string {alias} will be replaced by the alias of the root entity.

Fields Summary
private final String
sql
private final String
groupBy
private final org.hibernate.type.Type[]
types
private String[]
aliases
private String[]
columnAliases
private boolean
grouped
Constructors Summary
protected SQLProjection(String sql, String[] columnAliases, org.hibernate.type.Type[] types)

		this(sql, null, columnAliases, types);
	
protected SQLProjection(String sql, String groupBy, String[] columnAliases, org.hibernate.type.Type[] types)

		this.sql = sql;
		this.types = types;
		this.aliases = columnAliases;
		this.columnAliases = columnAliases;
		this.grouped = groupBy!=null;
		this.groupBy = groupBy;
	
Methods Summary
public java.lang.String[]getAliases()

		return aliases;
	
public java.lang.String[]getColumnAliases(java.lang.String alias, int loc)

		return null; //unsupported
	
public java.lang.String[]getColumnAliases(int loc)

		return columnAliases;
	
public org.hibernate.type.Type[]getTypes(java.lang.String alias, org.hibernate.Criteria crit, CriteriaQuery criteriaQuery)

		return null; //unsupported
	
public org.hibernate.type.Type[]getTypes(org.hibernate.Criteria crit, CriteriaQuery criteriaQuery)

		return types;
	
public booleanisGrouped()

		return grouped;
	
public java.lang.StringtoGroupSqlString(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)

		return StringHelper.replace( groupBy, "{alias}", criteriaQuery.getSQLAlias(criteria) );
	
public java.lang.StringtoSqlString(org.hibernate.Criteria criteria, int loc, CriteriaQuery criteriaQuery)

		return StringHelper.replace( sql, "{alias}", criteriaQuery.getSQLAlias(criteria) );
	
public java.lang.StringtoString()

		return sql;