use of org.jooq.CreateDomainAsStep in project jOOQ by jOOQ.
the class DDL method createDomain.
@SuppressWarnings({ "rawtypes", "unchecked" })
final Query createDomain(Domain<?> domain) {
CreateDomainAsStep s1 = configuration.createDomainIfNotExists() ? ctx.createDomainIfNotExists(domain) : ctx.createDomain(domain);
CreateDomainDefaultStep s2 = s1.as(domain.getDataType());
CreateDomainConstraintStep s3 = domain.getDataType().defaulted() ? s2.default_(domain.getDataType().default_()) : s2;
if (domain.getChecks().isEmpty())
return s3;
return s3.constraints(map(domain.getChecks(), c -> c.constraint()));
}
Aggregations