private String locateAppropriateDialectFunctionNameForAliasTest() {
   for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) {
     final Map.Entry entry = (Map.Entry) itr.next();
     final SQLFunction function = (SQLFunction) entry.getValue();
     if (!function.hasArguments() && !function.hasParenthesesIfNoArguments()) {
       return (String) entry.getKey();
     }
   }
   return null;
 }
Exemple #2
0
 private static boolean isFunction(
     String lcToken, String nextToken, SQLFunctionRegistry functionRegistry) {
   // checking for "(" is currently redundant because it is checked before getting here;
   // doing the check anyhow, in case that earlier check goes away;
   if ("(".equals(nextToken)) {
     return true;
   }
   SQLFunction function = functionRegistry.findSQLFunction(lcToken);
   if (function == null) {
     // lcToken does not refer to a function
     return false;
   }
   // if function.hasParenthesesIfNoArguments() is true, then assume
   // lcToken is not a function (since it is not followed by '(')
   return !function.hasParenthesesIfNoArguments();
 }
 protected String render(
     BasicType basic,
     List<String> columns,
     SessionFactory sessionFactory,
     SQLFunction sqlFunction) {
   return sqlFunction.render(basic, columns, (SessionFactoryImplementor) sessionFactory);
 }