Search in sources :

Example 1 with SourceCompiler

use of com.wplatform.ddal.util.SourceCompiler in project jdbc-shards by wplatform.

the class FunctionAlias method loadFromSource.

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);
        }
    }
}
Also used : Method(java.lang.reflect.Method) DbException(com.wplatform.ddal.message.DbException) InvocationTargetException(java.lang.reflect.InvocationTargetException) SourceCompiler(com.wplatform.ddal.util.SourceCompiler) DbException(com.wplatform.ddal.message.DbException)

Aggregations

DbException (com.wplatform.ddal.message.DbException)1 SourceCompiler (com.wplatform.ddal.util.SourceCompiler)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1