Class DbConstraintNaming
java.lang.Object
io.ebean.config.DbConstraintNaming
Naming convention used for constraint names.
Note that these constraint names are trimmed in the PlatformDdl which can be overridden but provides a decent default implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines how constraint names are shortened if required based on platform limitations. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected DbConstraintNaming.MaxLengthprotected DbConstraintNormaliseprotected Stringprotected Stringprotected Stringprotected String -
Constructor Summary
ConstructorsConstructorDescriptionConstruct using default of lower case for both table and column names.DbConstraintNaming(boolean lowerCase) Construct specifying if lower case should be used (for both table and column names).DbConstraintNaming(boolean lowerCaseTableNames, boolean lowerCaseColumnNames) Construct specifying if lower case should be used for both table and column names. -
Method Summary
Modifier and TypeMethodDescriptioncheckConstraintName(String tableName, String columnName) Return the check constraint name.foreignKeyConstraintName(String tableName, String columnName) Return the foreign key constraint name given a single column foreign key.foreignKeyIndexName(String tableName, String column) Return the index name associated with a foreign key constraint given a single column foreign key.foreignKeyIndexName(String tableName, String[] columns) Return the index name associated with a foreign key constraint given multiple columns.Return the MaxLength implementation used to truncate/shorten db constraint names as necessary.Return the index name for a general index (not associated with a foreign key).Return the index name for a general index (not associated with a foreign key).protected StringjoinColumnNames(String[] columns) Join the column names together with underscores.normaliseColumn(String tableName) Normalise the column name by removing any quoted identifier characters (",',[,] etc).normaliseTable(String tableName) Normalise the table name by trimming catalog and schema and removing any quoted identifier characters (",',[,] etc).primaryKeyName(String tableName) Return the primary key constraint name.voidsetMaxLength(DbConstraintNaming.MaxLength maxLength) Set the MaxLength implementation used to truncate/shorten db constraint names as necessary.uniqueConstraintName(String tableName, String columnName) Return the unique constraint name.uniqueConstraintName(String tableName, String[] columns) Return the unique constraint name.
-
Field Details
-
pkPrefix
-
pkSuffix
-
fkPrefix
-
fkMiddle
-
fkSuffix
-
fkIndexPrefix
-
fkIndexMiddle
-
fkIndexSuffix
-
indexPrefix
-
indexMiddle
-
indexSuffix
-
uqPrefix
-
uqSuffix
-
ckPrefix
-
ckSuffix
-
maxLength
-
normalise
-
-
Constructor Details
-
DbConstraintNaming
public DbConstraintNaming()Construct using default of lower case for both table and column names. -
DbConstraintNaming
public DbConstraintNaming(boolean lowerCase) Construct specifying if lower case should be used (for both table and column names). -
DbConstraintNaming
public DbConstraintNaming(boolean lowerCaseTableNames, boolean lowerCaseColumnNames) Construct specifying if lower case should be used for both table and column names.
-
-
Method Details
-
getMaxLength
Return the MaxLength implementation used to truncate/shorten db constraint names as necessary. -
setMaxLength
Set the MaxLength implementation used to truncate/shorten db constraint names as necessary. -
-
foreignKeyConstraintName
-
foreignKeyIndexName
-
foreignKeyIndexName
-
indexName
-
indexName
-
joinColumnNames
-
uniqueConstraintName
-
uniqueConstraintName
-
checkConstraintName
-
normaliseTable
-
normaliseColumn
-