Interface Index

All Superinterfaces:
Commented, ModelElement
All Known Implementing Classes:
IndexImpl

public interface Index extends ModelElement, Commented
Describes a database index.
Author:
harald
  • Method Details

    • getEntity

      Entity getEntity()
      Gets the entity this index belongs to.
      Returns:
      the entity
    • createDatabaseIndexName

      String createDatabaseIndexName(Entity entity)
      Creates the database index name for the given entity.
      Parameters:
      entity - the entity
      Returns:
      the effective SQL name
    • 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
    • getAttributes

      List<IndexAttribute> getAttributes()
      Gets the index attributes.
      Returns:
      the attributes
    • validate

      void validate() throws ModelException
      Validates the index.
      Throws:
      ModelException - if validation failed
    • sqlCreateIndex

      String sqlCreateIndex(Backend backend, Entity entity)
      Creates the index creation SQL code.
      Parameters:
      backend - the backend to create SQL code for
      entity - the entity to create the index for
      Returns:
      the SQL code