Search in sources :

Example 1 with CreateAggregate

use of org.h2.command.ddl.CreateAggregate in project h2database by h2database.

the class Parser method parseCreateAggregate.

private CreateAggregate parseCreateAggregate(boolean force) {
    boolean ifNotExists = readIfNotExists();
    CreateAggregate command = new CreateAggregate(session);
    command.setForce(force);
    String name = readIdentifierWithSchema();
    if (isKeyword(name) || Function.getFunction(database, name) != null || getAggregateType(name) != null) {
        throw DbException.get(ErrorCode.FUNCTION_ALIAS_ALREADY_EXISTS_1, name);
    }
    command.setName(name);
    command.setSchema(getSchema());
    command.setIfNotExists(ifNotExists);
    read("FOR");
    command.setJavaClassMethod(readUniqueIdentifier());
    return command;
}
Also used : ValueString(org.h2.value.ValueString) CreateAggregate(org.h2.command.ddl.CreateAggregate)

Aggregations

CreateAggregate (org.h2.command.ddl.CreateAggregate)1 ValueString (org.h2.value.ValueString)1