Search in sources :

Example 1 with AggregateFunction

use of org.h2.api.AggregateFunction in project h2database by h2database.

the class UserAggregate method getInstance.

public Aggregate getInstance() {
    if (javaClass == null) {
        javaClass = JdbcUtils.loadUserClass(className);
    }
    Object obj;
    try {
        obj = javaClass.newInstance();
        Aggregate agg;
        if (obj instanceof Aggregate) {
            agg = (Aggregate) obj;
        } else {
            agg = new AggregateWrapper((AggregateFunction) obj);
        }
        return agg;
    } catch (Exception e) {
        throw DbException.convert(e);
    }
}
Also used : AggregateFunction(org.h2.api.AggregateFunction) Aggregate(org.h2.api.Aggregate) SQLException(java.sql.SQLException) DbException(org.h2.message.DbException)

Aggregations

SQLException (java.sql.SQLException)1 Aggregate (org.h2.api.Aggregate)1 AggregateFunction (org.h2.api.AggregateFunction)1 DbException (org.h2.message.DbException)1