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; }
@Override public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { final Type countFunctionReturnType = getFunction( criteriaQuery ).getReturnType( null, criteriaQuery.getFactory() ); return new Type[] { countFunctionReturnType }; }
public Type findFunctionReturnType(String functionName, SQLFunction sqlFunction, AST firstArgument) { // determine the type of the first argument... Type argumentType = null; if ( firstArgument != null ) { if ( "cast".equals( functionName ) ) { argumentType = sfi.getTypeResolver().heuristicType( firstArgument.getNextSibling().getText() ); } else if ( SqlNode.class.isInstance( firstArgument ) ) { argumentType = ( (SqlNode) firstArgument ).getDataType(); } } return sqlFunction.getReturnType( argumentType, sfi ); }
@Override public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return new Type[] { getFunction( criteriaQuery ).getReturnType( criteriaQuery.getType( criteria, getPropertyName() ), criteriaQuery.getFactory() ) }; }
@Override public Type getDataType() { Type type = super.getDataType(); if ( type != null ) { return type; } FromElement fe = getFromElement(); if ( fe != null ) { return fe.getDataType(); } SQLFunction sf = getWalker().getSessionFactoryHelper().findSQLFunction( getText() ); if ( sf != null ) { return sf.getReturnType( null, getWalker().getSessionFactoryHelper().getFactory() ); } return null; }
if ( "*".equals( token ) ) { q.addSelectScalar( getFunction( "count", q ).getReturnType( StandardBasicTypes.LONG, q.getFactory() ) );
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; }
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; }
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; }
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; }
public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return new Type[] { getFunction( criteriaQuery ).getReturnType( null, criteriaQuery.getFactory() ) }; }
public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException { return new Type[] { getFunction( criteriaQuery ).getReturnType( null, criteriaQuery.getFactory() ) }; }
/** * Find the function return type given the function name and the first argument expression node. * * @param functionName The function name. * @param first The first argument expression. * @return the function return type given the function name and the first argument expression node. */ Type findFunctionReturnType(String functionName, AST first) { Type argumentType = null; if ( first != null && first instanceof SqlNode ) { SqlNode sqlNode = ( SqlNode ) first; argumentType = sqlNode.getDataType(); } // This implementation is a bit strange, but then that's why this helper exists. Type functionReturnType = requireSQLFunction( functionName ).getReturnType( argumentType, sfi ); return functionReturnType; }
public Type findFunctionReturnType(String functionName, SQLFunction sqlFunction, AST firstArgument) { // determine the type of the first argument... Type argumentType = null; if ( firstArgument != null ) { if ( "cast".equals(functionName) ) { argumentType = sfi.getTypeResolver().heuristicType( firstArgument.getNextSibling().getText() ); } else if ( SqlNode.class.isInstance( firstArgument ) ) { argumentType = ( (SqlNode) firstArgument ).getDataType(); } } return sqlFunction.getReturnType( argumentType, sfi ); }
public Type findFunctionReturnType(String functionName, SQLFunction sqlFunction, AST firstArgument) { // determine the type of the first argument... Type argumentType = null; if ( firstArgument != null ) { if ( "cast".equals(functionName) ) { argumentType = sfi.getTypeResolver().heuristicType( firstArgument.getNextSibling().getText() ); } else if ( SqlNode.class.isInstance( firstArgument ) ) { argumentType = ( (SqlNode) firstArgument ).getDataType(); } } return sqlFunction.getReturnType( argumentType, sfi ); }
/** * {@inheritDoc} */ 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() ) }; }
public Type getDataType() { Type type = super.getDataType(); if (type!=null) return type; FromElement fe = getFromElement(); if (fe!=null) return fe.getDataType(); SQLFunction sf = getWalker().getSessionFactoryHelper().findSQLFunction( getText() ); return sf==null ? null : sf.getReturnType(null, null); }
public Type getDataType() { Type type = super.getDataType(); if (type != null) return type; FromElement fe = getFromElement(); if (fe != null) return fe.getDataType(); SQLFunction sf = getWalker().getSessionFactoryHelper().findSQLFunction(getText()); return sf == null ? null : sf.getReturnType(null, null); }
@Override public Type getDataType() { Type type = super.getDataType(); if ( type != null ) { return type; } FromElement fe = getFromElement(); if ( fe != null ) { return fe.getDataType(); } SQLFunction sf = getWalker().getSessionFactoryHelper().findSQLFunction( getText() ); if ( sf != null ) { return sf.getReturnType( null, getWalker().getSessionFactoryHelper().getFactory() ); } return null; }