Hibernate ORM SQLFunction - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM SQLFunction class.

This code example shows how to use the following methods:render
				getFunction( criteriaQuery ).getReturnType( null, criteriaQuery.getFactory() )
		}; 
	} 
 
	public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery) throws HibernateException {
		return getFunction( criteriaQuery ).render( null, ARGS, criteriaQuery.getFactory() )
				+ " as y" + position + '_';
	} 
 
	protected SQLFunction getFunction(CriteriaQuery criteriaQuery) {
		SQLFunction function = criteriaQuery.getFactory()
				.getSqlFunctionRegistry()
				.findSQLFunction( "count" );
		if ( function == null ) {
			throw new HibernateException( "Unable to locate count function mapping" );
		} 
		return function;
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getReturnType
	} 
 
	public String toString() {
		return functionName + "(" + propertyName + ')';
	} 
 
	/** 
	 * {@inheritDoc} 
	 */ 
	public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
		return new Type[] {
				getFunction( criteriaQuery ).getReturnType(
						criteriaQuery.getType( criteria, getPropertyName() ),
						criteriaQuery.getFactory()
				) 
		}; 
	} 
 
	/** 
	 * {@inheritDoc} 
4
CodeRank
This code example shows how to use the following methods:hasParenthesesIfNoArguments
	public boolean aggregateHasArgs(String funcToken, QueryTranslatorImpl q) {
		return getFunction( funcToken, q ).hasArguments();
	} 
 
	public boolean aggregateFuncNoArgsHasParenthesis(String funcToken, QueryTranslatorImpl q) {
		return getFunction( funcToken, q ).hasParenthesesIfNoArguments();
	} 
 
	public Type aggregateType(List funcTokenList, Type type, QueryTranslatorImpl q) throws QueryException {
		Type retType = type;
		Type argType;
		for ( int i = funcTokenList.size() - 1; i >= 0; i-- ) {
			argType = retType;
			String funcToken = ( String ) funcTokenList.get( i );
			retType = getFunction( funcToken, q ).getReturnType( argType, q.getFactory() );
		} 
		return retType;
	} 
 
	private SQLFunction getFunction(String name, QueryTranslatorImpl q) {
4
CodeRank
This code example shows how to use the following methods:getReturnType
This code example shows how to use the following methods:render
		void clause(String clause); 
 
		/** 
		 * todo remove this hack 
		 * The parameter is either ", " or " , ". This is needed to pass sql generating tests as the old 
		 * sql generator uses " , " in the WHERE and ", " in SELECT. 
		 * 
		 * @param comma either " , " or ", " 
		 */ 
		void commaBetweenParameters(String comma); 
	} 
 
	/** 
	 * SQL function processing code redirects generated SQL output to an instance of this class 
	 * which catches function arguments. 
	 */ 
	class FunctionArguments implements SqlWriter { 
		private int argInd; 
		private final List<String> args = new ArrayList<String>(3); 
 
4
CodeRank
See Code Examples for Hibernate ORM SQLFunction Methods: