use of org.jooq.meta.DomainDefinition in project jOOQ by jOOQ.
the class HSQLDBDatabase method getDomains0.
@Override
protected List<DomainDefinition> getDomains0() throws SQLException {
List<DomainDefinition> result = new ArrayList<>();
DomainConstraints dc = DOMAIN_CONSTRAINTS.as("dc");
for (Record record : create().select(dc.domains().DOMAIN_SCHEMA, dc.domains().DOMAIN_NAME, dc.domains().DATA_TYPE, dc.domains().CHARACTER_MAXIMUM_LENGTH, dc.domains().NUMERIC_PRECISION, dc.domains().NUMERIC_SCALE, dc.domains().DOMAIN_DEFAULT, dc.checkConstraints().CHECK_CLAUSE).from(dc).where(dc.domains().DOMAIN_SCHEMA.in(getInputSchemata())).orderBy(dc.domains().DOMAIN_SCHEMA, dc.domains().DOMAIN_NAME)) {
SchemaDefinition schema = getSchema(record.get(dc.domains().DOMAIN_SCHEMA));
DataTypeDefinition baseType = new DefaultDataTypeDefinition(this, schema, record.get(dc.domains().DATA_TYPE), record.get(dc.domains().CHARACTER_MAXIMUM_LENGTH), record.get(dc.domains().NUMERIC_PRECISION), record.get(dc.domains().NUMERIC_SCALE), true, record.get(dc.domains().DOMAIN_DEFAULT));
DefaultDomainDefinition domain = new DefaultDomainDefinition(schema, record.get(dc.domains().DOMAIN_NAME), baseType);
if (!StringUtils.isBlank(record.get(dc.checkConstraints().CHECK_CLAUSE)))
domain.addCheckClause(record.get(dc.checkConstraints().CHECK_CLAUSE));
result.add(domain);
}
return result;
}
Aggregations