SQLProjectionpublic class SQLProjection extends Object implements ProjectionA 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 boolean | isGrouped()
return grouped;
| public java.lang.String | toGroupSqlString(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)
return StringHelper.replace( groupBy, "{alias}", criteriaQuery.getSQLAlias(criteria) );
| public java.lang.String | toSqlString(org.hibernate.Criteria criteria, int loc, CriteriaQuery criteriaQuery)
return StringHelper.replace( sql, "{alias}", criteriaQuery.getSQLAlias(criteria) );
| public java.lang.String | toString()
return sql;
|
|