use of org.h2.command.ddl.CreateUserDataType in project h2database by h2database.
the class Parser method parseCreateUserDataType.
private CreateUserDataType parseCreateUserDataType() {
boolean ifNotExists = readIfNotExists();
CreateUserDataType command = new CreateUserDataType(session);
command.setTypeName(readUniqueIdentifier());
read("AS");
Column col = parseColumnForTable("VALUE", true);
if (readIf("CHECK")) {
Expression expr = readExpression();
col.addCheckConstraint(session, expr);
}
col.rename(null);
command.setColumn(col);
command.setIfNotExists(ifNotExists);
return command;
}
Aggregations