use of org.jooq.ConstraintEnforcementStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseCheckSpecification.
private final Constraint parseCheckSpecification(ConstraintTypeStep constraint) {
boolean parens = parseIf('(');
Condition condition = parseCondition();
if (parens)
parse(')');
ConstraintEnforcementStep e = constraint == null ? check(condition) : constraint.check(condition);
return parseConstraintEnforcementIf(e);
}
use of org.jooq.ConstraintEnforcementStep in project jOOQ by jOOQ.
the class DefaultParseContext method parsePrimaryKeySpecification.
private final Constraint parsePrimaryKeySpecification(ConstraintTypeStep constraint) {
parseUsingIndexTypeIf();
Field<?>[] fieldNames = parseKeyColumnList();
ConstraintEnforcementStep e = constraint == null ? primaryKey(fieldNames) : constraint.primaryKey(fieldNames);
parseUsingIndexTypeIf();
return parseConstraintEnforcementIf(e);
}
use of org.jooq.ConstraintEnforcementStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseUniqueSpecification.
private final Constraint parseUniqueSpecification(ConstraintTypeStep constraint) {
parseUsingIndexTypeIf();
// [#9246] In MySQL, there's a syntax where the unique constraint looks like an index:
// ALTER TABLE t ADD UNIQUE INDEX i (c)
Name constraintName;
if (constraint == null && (constraintName = parseIdentifierIf()) != null)
constraint = constraint(constraintName);
Field<?>[] fieldNames = parseKeyColumnList();
ConstraintEnforcementStep e = constraint == null ? unique(fieldNames) : constraint.unique(fieldNames);
parseUsingIndexTypeIf();
return parseConstraintEnforcementIf(e);
}
Aggregations