@Override public String getName() { return functionAlias.getName(); }
@Override public String getSQL() { // TODO can remove this method once FUNCTIONS_IN_SCHEMA is enabled if (database.getSettings().functionsInSchema || !getSchema().getName().equals(Constants.SCHEMA_MAIN)) { return super.getSQL(); } return Parser.quoteIdentifier(getName()); }
/** * Find the Java method that matches the arguments. * * @param args the argument list * @return the Java method * @throws DbException if no matching method could be found */ public JavaMethod findJavaMethod(Expression[] args) { load(); int parameterCount = args.length; for (JavaMethod m : javaMethods) { int count = m.getParameterCount(); if (count == parameterCount || (m.isVarArgs() && count <= parameterCount + 1)) { return m; } } throw DbException.get(ErrorCode.METHOD_NOT_FOUND_1, getName() + " (" + className + ", parameter count: " + parameterCount + ")"); }
private void loadFromSource() { SourceCompiler compiler = database.getCompiler(); synchronized (compiler) { String fullClassName = Constants.USER_PACKAGE + "." + getName(); compiler.setSource(fullClassName, source); try { Method m = compiler.getMethod(fullClassName); JavaMethod method = new JavaMethod(m, 0); javaMethods = new JavaMethod[] { method }; } catch (DbException e) { throw e; } catch (Exception e) { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, e, source); } } }
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(); // TODO always append the schema once FUNCTIONS_IN_SCHEMA is enabled if (functionAlias.getDatabase().getSettings().functionsInSchema || !functionAlias.getSchema().getName().equals(Constants.SCHEMA_MAIN)) { buff.append( Parser.quoteIdentifier(functionAlias.getSchema().getName())) .append('.'); } buff.append(Parser.quoteIdentifier(functionAlias.getName())).append('('); for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(e.getSQL()); } return buff.append(')').toString(); }
public String getName() { return functionAlias.getName(); }
@Override public String getName() { return functionAlias.getName(); }
@Override public String getName() { return functionAlias.getName(); }
public String getSQL() { StringBuffer buff = new StringBuffer(); buff.append(Parser.quoteIdentifier(functionAlias.getName())); buff.append('('); for (int i = 0; i < args.length; i++) { if (i > 0) { buff.append(", "); } Expression e = args[i]; buff.append(e.getSQL()); } buff.append(')'); return buff.toString(); }
@Override public String getSQL() { // TODO can remove this method once FUNCTIONS_IN_SCHEMA is enabled if (database.getSettings().functionsInSchema || !getSchema().getName().equals(Constants.SCHEMA_MAIN)) { return super.getSQL(); } return Parser.quoteIdentifier(getName()); }
@Override public String getSQL() { // TODO can remove this method once FUNCTIONS_IN_SCHEMA is enabled if (database.getSettings().functionsInSchema || !getSchema().getName().equals(Constants.SCHEMA_MAIN)) { return super.getSQL(); } return Parser.quoteIdentifier(getName()); }
/** * Find the Java method that matches the arguments. * * @param args the argument list * @return the Java method * @throws DbException if no matching method could be found */ public JavaMethod findJavaMethod(Expression[] args) { load(); int parameterCount = args.length; for (JavaMethod m : javaMethods) { int count = m.getParameterCount(); if (count == parameterCount || (m.isVarArgs() && count <= parameterCount + 1)) { return m; } } throw DbException.get(ErrorCode.METHOD_NOT_FOUND_1, getName() + " (" + className + ", parameter count: " + parameterCount + ")"); }
/** * Find the Java method that matches the arguments. * * @param args the argument list * @return the Java method * @throws DbException if no matching method could be found */ public JavaMethod findJavaMethod(Expression[] args) { load(); int parameterCount = args.length; for (JavaMethod m : javaMethods) { int count = m.getParameterCount(); if (count == parameterCount || (m.isVarArgs() && count <= parameterCount + 1)) { return m; } } throw DbException.get(ErrorCode.METHOD_NOT_FOUND_1, getName() + " (" + className + ", parameter count: " + parameterCount + ")"); }
private void loadFromSource() { SourceCompiler compiler = database.getCompiler(); synchronized (compiler) { String fullClassName = Constants.USER_PACKAGE + "." + getName(); compiler.setSource(fullClassName, source); try { Method m = compiler.getMethod(fullClassName); JavaMethod method = new JavaMethod(m, 0); javaMethods = new JavaMethod[] { method }; } catch (DbException e) { throw e; } catch (Exception e) { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, e, source); } } }
private void loadFromSource() { SourceCompiler compiler = database.getCompiler(); synchronized (compiler) { String fullClassName = Constants.USER_PACKAGE + "." + getName(); compiler.setSource(fullClassName, source); try { Method m = compiler.getMethod(fullClassName); JavaMethod method = new JavaMethod(m, 0); javaMethods = new JavaMethod[] { method }; } catch (DbException e) { throw e; } catch (Exception e) { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, e, source); } } }
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(); // TODO always append the schema once FUNCTIONS_IN_SCHEMA is enabled if (functionAlias.getDatabase().getSettings().functionsInSchema || !functionAlias.getSchema().getName().equals(Constants.SCHEMA_MAIN)) { buff.append( Parser.quoteIdentifier(functionAlias.getSchema().getName())) .append('.'); } buff.append(Parser.quoteIdentifier(functionAlias.getName())).append('('); for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(e.getSQL()); } return buff.append(')').toString(); }
@Override public String getSQL() { StatementBuilder buff = new StatementBuilder(); // TODO always append the schema once FUNCTIONS_IN_SCHEMA is enabled if (functionAlias.getDatabase().getSettings().functionsInSchema || !functionAlias.getSchema().getName().equals(Constants.SCHEMA_MAIN)) { buff.append( Parser.quoteIdentifier(functionAlias.getSchema().getName())) .append('.'); } buff.append(Parser.quoteIdentifier(functionAlias.getName())).append('('); for (Expression e : args) { buff.appendExceptFirst(", "); buff.append(e.getSQL()); } return buff.append(')').toString(); }