/** * A property minimum value projection * * @param propertyName The property for which to find the min * * @return the min projection * * @see AggregateProjection */ public static AggregateProjection min(String propertyName) { return new AggregateProjection( "min", propertyName ); }
@Override public String toSqlString(Criteria criteria, int loc, CriteriaQuery criteriaQuery) throws HibernateException { final String functionFragment = getFunction( criteriaQuery ).render( criteriaQuery.getType( criteria, getPropertyName() ), buildFunctionParameterList( criteria, criteriaQuery ), criteriaQuery.getFactory() ); return functionFragment + " as y" + loc + '_'; }
protected SQLFunction getFunction(CriteriaQuery criteriaQuery) { return getFunction( getFunctionName(), criteriaQuery ); }
protected List buildFunctionParameterList(Criteria criteria, CriteriaQuery criteriaQuery) { return buildFunctionParameterList( criteriaQuery.getColumn( criteria, getPropertyName() ) ); }
@Override public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return new Type[] { getFunction( criteriaQuery ).getReturnType( criteriaQuery.getType( criteria, getPropertyName() ), criteriaQuery.getFactory() ) }; }
/** * {@inheritDoc} */ public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return new Type[] { getFunction( criteriaQuery ).getReturnType( criteriaQuery.getType( criteria, getPropertyName() ), criteriaQuery.getFactory() ) }; }
protected List buildFunctionParameterList(Criteria criteria, CriteriaQuery criteriaQuery) { return buildFunctionParameterList( criteriaQuery.getColumn( criteria, getPropertyName() ) ); }
protected SQLFunction getFunction(CriteriaQuery criteriaQuery) { return getFunction( getFunctionName(), criteriaQuery ); }
/** * A property maximum value projection * * @param propertyName The property for which to find the max * * @return the max projection * * @see AggregateProjection */ public static AggregateProjection max(String propertyName) { return new AggregateProjection( "max", propertyName ); }
/** * {@inheritDoc} */ public String toSqlString(Criteria criteria, int loc, CriteriaQuery criteriaQuery) throws HibernateException { final String functionFragment = getFunction( criteriaQuery ).render( criteriaQuery.getType( criteria, getPropertyName() ), buildFunctionParameterList( criteria, criteriaQuery ), criteriaQuery.getFactory() ); return functionFragment + " as y" + loc + '_'; }
/** * {@inheritDoc} */ public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return new Type[] { getFunction( criteriaQuery ).getReturnType( criteriaQuery.getType( criteria, getPropertyName() ), criteriaQuery.getFactory() ) }; }
protected List buildFunctionParameterList(Criteria criteria, CriteriaQuery criteriaQuery) { return buildFunctionParameterList( criteriaQuery.getColumn( criteria, getPropertyName() ) ); }
protected SQLFunction getFunction(CriteriaQuery criteriaQuery) { return getFunction( getFunctionName(), criteriaQuery ); }
/** * A property value sum projection * * @param propertyName The property over which to sum * * @return the sum projection * * @see AggregateProjection */ public static AggregateProjection sum(String propertyName) { return new AggregateProjection( "sum", propertyName ); }
/** * {@inheritDoc} */ public String toSqlString(Criteria criteria, int loc, CriteriaQuery criteriaQuery) throws HibernateException { final String functionFragment = getFunction( criteriaQuery ).render( criteriaQuery.getType( criteria, getPropertyName() ), buildFunctionParameterList( criteria, criteriaQuery ), criteriaQuery.getFactory() ); return functionFragment + " as y" + loc + '_'; }
/** * A property value sum */ public static AggregateProjection sum(String propertyName) { return new AggregateProjection("sum", propertyName); }