Interface Index
- All Superinterfaces:
Commented, ModelElement
- All Known Implementing Classes:
IndexImpl
-
Method Summary
Modifier and TypeMethodDescriptioncreateDatabaseIndexName(Entity entity) Creates the database index name for the given entity.Gets the index attributes.Gets the deferrability of this index's unique constraint.
Only meaningful for unique indexes:validate()rejects a deferrability other thanDeferrability.NOT_DEFERRABLEon a non-unique index.Gets the entity this index belongs to.Gets the optional filter condition.booleanReturns whether the index is optional.
Such an index is only created if the backend supports all features, especially functions and conditions.booleanisUnique()Returns whether the index is unique.sqlCreateIndex(Backend backend, Entity entity) Creates the index creation SQL code.voidvalidate()Validates the index.Methods inherited from interface Commented
getComment, getLongCommentMethods inherited from interface ModelElement
getModel, getName, getOrdinal, getParent, getSourceInfo
-
Method Details
-
getEntity
-
createDatabaseIndexName
-
isUnique
boolean isUnique()Returns whether the index is unique.- Returns:
- true if unique, else non-unique
-
isOptional
boolean isOptional()Returns whether the index is optional.
Such an index is only created if the backend supports all features, especially functions and conditions.- Returns:
- true to issue only a warning if backend doesn't support it, false to abort the build process in such a case
-
getFilterCondition
String getFilterCondition()Gets the optional filter condition.- Returns:
- the condition, null if none
-
getDeferrability
Deferrability getDeferrability()Gets the deferrability of this index's unique constraint.
Only meaningful for unique indexes:validate()rejects a deferrability other thanDeferrability.NOT_DEFERRABLEon a non-unique index.- Returns:
- the deferrability,
Deferrability.NOT_DEFERRABLEif none
-
getAttributes
-
validate
Validates the index.- Throws:
ModelException- if validation failed
-
sqlCreateIndex
Creates the index creation SQL code.- Parameters:
backend- the backend to create SQL code forentity- the entity to create the index for- Returns:
- the SQL code
- Throws:
BackendException- if the index is not optional and not supported by the backend
-