- All Superinterfaces:
ModelElement
- All Known Implementing Classes:
IndexImpl
Describes a database index.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptioncreateDatabaseIndexName(Entity entity) Creates the database index name for given entity.Gets the index attributes.Gets the comment.Gets the entity this index belongs to.Gets the optional filter condition.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 org.tentackle.model.ModelElement
getName, getOrdinal, getParent, getSourceInfo
-
Method Details
-
getEntity
Entity getEntity()Gets the entity this index belongs to.- Returns:
- the entity
-
createDatabaseIndexName
Creates the database index name for given entity.- Parameters:
entity- the entity- Returns:
- the effective sql name
-
getComment
String getComment()Gets the comment.- Returns:
- the comment
-
isUnique
boolean isUnique()Returns whether the index is unique.- Returns:
- true if unique, else non-unique
-
getFilterCondition
String getFilterCondition()Gets the optional filter condition.- Returns:
- the condition, null if none
-
getAttributes
List<IndexAttribute> getAttributes()Gets the index attributes.- Returns:
- the attributes
-
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
-