-
- All Superinterfaces:
ModelElement
- All Known Implementing Classes:
IndexImpl
public interface Index extends ModelElement
Describes a database index.- Author:
- harald
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringcreateDatabaseIndexName(Entity entity)Creates the database index name for given entity.java.util.List<IndexAttribute>getAttributes()Gets the index attributes.java.lang.StringgetComment()Gets the comment.EntitygetEntity()Gets the entity this index belongs to.java.lang.StringgetFilterCondition()Gets the optional filter condition.booleanisUnique()Returns whether the index is unique.java.lang.StringsqlCreateIndex(org.tentackle.sql.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 Detail
-
getEntity
Entity getEntity()
Gets the entity this index belongs to.- Returns:
- the entity
-
createDatabaseIndexName
java.lang.String createDatabaseIndexName(Entity entity)
Creates the database index name for given entity.- Parameters:
entity- the entity- Returns:
- the effective sql name
-
getComment
java.lang.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
java.lang.String getFilterCondition()
Gets the optional filter condition.- Returns:
- the condition, null if none
-
getAttributes
java.util.List<IndexAttribute> getAttributes()
Gets the index attributes.- Returns:
- the attributes
-
validate
void validate() throws ModelExceptionValidates the index.- Throws:
ModelException- if validation failed
-
sqlCreateIndex
java.lang.String sqlCreateIndex(org.tentackle.sql.Backend backend, Entity entity)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
-
-