public final class ConstraintModel extends Object
type() is a string (PK / FK / UNIQUE / CHECK / NOT_NULL) so the
model stays forward-compatible with vendor-specific constraint flavors.
Foreign-key targets. referencedTable() and
referencedColumns() carry the FK target side and mirror
TConstraint.getReferencedObject() /
TConstraint.getReferencedColumnList() on
the AST side. The model is permissive: both fields may be set on any
constraint type, but CatalogModelValidator
enforces FK-specific semantics (required target table, matching column counts,
resolvable target table + columns).
referencedTable() is a single string and may carry a qualified
name (e.g. "schema.table"). It is the catalog-side counterpart of
TObjectName.toString().
| Modifier and Type | Class and Description |
|---|---|
static class |
ConstraintModel.Builder |
| Modifier and Type | Method and Description |
|---|---|
static ConstraintModel.Builder |
builder() |
List<String> |
columns() |
boolean |
equals(Object o) |
int |
hashCode() |
String |
name() |
List<String> |
referencedColumns()
Target columns on the foreign-key
referencedTable(), ordered
to align positionally with columns(). |
String |
referencedTable()
Target table for a foreign-key constraint, or
null for non-FK
constraints. |
String |
toString() |
String |
type()
PK / FK / UNIQUE / CHECK / NOT_NULL — string for forward compatibility.
|
public static ConstraintModel.Builder builder()
public String referencedTable()
null for non-FK
constraints. May be a single name ("orders") or qualified
("shop.orders" / "catalog.shop.orders"). Resolution is
up to the validator / runtime; the model itself does not interpret dots.public List<String> referencedColumns()
referencedTable(), ordered
to align positionally with columns(). Empty (never null)
for non-FK constraints.