Package org.hibernate.mapping
Class Constraint
java.lang.Object
org.hibernate.mapping.Constraint
- All Implemented Interfaces:
Serializable,Exportable
- Direct Known Subclasses:
ForeignKey,PrimaryKey,UniqueKey
A mapping model object representing a constraint on a relational database table.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddColumns(Value value) booleancontainsColumn(Column column) abstract StringDeprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removedstatic StringgenerateName(String prefix, Table table, List<Column> columns) Deprecated, for removal: This API element is subject to removal in a future version.This method does not respect theImplicitNamingStrategystatic StringgenerateName(String prefix, Table table, Column... columns) Deprecated, for removal: This API element is subject to removal in a future version.This method does not respect theImplicitNamingStrategygetColumn(int i) intgetName()getTable()static StringhashedName(String name) Deprecated, for removal: This API element is subject to removal in a future version.Only used from deprecated methodsbooleanisGenerated(Dialect dialect) Deprecated, for removal: This API element is subject to removal in a future version.No longer usedvoidvoidabstract StringsqlConstraintString(SqlStringGenerationContext context, String constraintName, String defaultCatalog, String defaultSchema) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer calledtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.boot.model.relational.Exportable
getExportIdentifier
-
Constructor Details
-
Constraint
public Constraint()
-
-
Method Details
-
getName
-
setName
-
generateName
@Deprecated(since="6.5", forRemoval=true) public static String generateName(String prefix, Table table, Column... columns) Deprecated, for removal: This API element is subject to removal in a future version.This method does not respect theImplicitNamingStrategyIf a constraint is not explicitly named, this is called to generate a unique hash using the table and column names. Static so the name can be generated prior to creating the Constraint. They're cached, keyed by name, in multiple locations.- Returns:
- String The generated name
-
generateName
@Deprecated(since="6.5", forRemoval=true) public static String generateName(String prefix, Table table, List<Column> columns) Deprecated, for removal: This API element is subject to removal in a future version.This method does not respect theImplicitNamingStrategyHelper method forgenerateName(String, Table, Column...).- Returns:
- String The generated name
-
hashedName
Deprecated, for removal: This API element is subject to removal in a future version.Only used from deprecated methodsHash a constraint name using MD5. Convert the MD5 digest to base 35 (full alphanumeric), guaranteeing that the length of the name will always be smaller than the 30 character identifier restriction enforced by a few dialects.- Parameters:
name- The name to be hashed.- Returns:
- String The hashed name.
-
addColumn
-
addColumns
-
containsColumn
- Returns:
- true if this constraint already contains a column with same name.
-
getColumnSpan
public int getColumnSpan() -
getColumn
-
getTable
-
setTable
-
isGenerated
Deprecated, for removal: This API element is subject to removal in a future version.No longer used -
getColumns
-
sqlConstraintString
@Deprecated(since="6.2", forRemoval=true) public abstract String sqlConstraintString(SqlStringGenerationContext context, String constraintName, String defaultCatalog, String defaultSchema) Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer called -
toString
-
generatedConstraintNamePrefix
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed- Returns:
- String The prefix to use in generated constraint names. Examples: "UK_", "FK_", and "PK_".
-