Interface DBIndexCapability

  • All Superinterfaces:
    DFCapability

    public interface DBIndexCapability
    extends DFCapability
    Capability for managing indexes in the database.

    Changes in indexes can be observed as model changes notified from DFSchema.

    Author:
    svata
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canBeDropped​(com.im.commons.db.ddl.DBIndexInfo index)
      Can the specified index be dropped?
      boolean canBeRebuilded​(com.im.commons.db.ddl.DBIndexInfo index)
      Can the specified index be rebuild?
      void createIndex​(java.lang.String index, java.lang.String indexType, com.im.commons.db.ddl.DBTableInfo table, java.util.List<java.lang.String> columns, java.util.List<java.lang.Boolean> order, com.im.commons.progress.DFEnvironmentRW env)
      Creates an index over the specified table of the given type.
      void dropIndex​(com.im.commons.db.ddl.DBIndexInfo index, com.im.commons.progress.DFEnvironmentRW env)
      Drops the specified index.
      com.im.commons.db.ddl.DBIndexInfo findIndex​(com.im.commons.db.ddl.DBTableInfo table, java.util.List<java.lang.String> columns)
      Will try to find and return indexes for the columns provided.
      void rebuildIndex​(com.im.commons.db.ddl.DBIndexInfo index, com.im.commons.progress.DFEnvironmentRW env)
      Rebuild the specified index.
    • Method Detail

      • createIndex

        void createIndex​(java.lang.String index,
                         java.lang.String indexType,
                         com.im.commons.db.ddl.DBTableInfo table,
                         java.util.List<java.lang.String> columns,
                         java.util.List<java.lang.Boolean> order,
                         com.im.commons.progress.DFEnvironmentRW env)
        Creates an index over the specified table of the given type. The passed columns will form the index, in the exact specified order. The ascending/descending order is specified by the 'order' parameter. If 'order' is null, all columns are indexed ascending.

        TODO API - we must add some proxy method to API to delegate to DatabasePlatform. Contact us if you need it.

        Parameters:
        index - The name of the new index. The name must not be already used by an index.
        indexType - The type of the index. Consult implementation class com.im.df.core.DatabasePlatform.supportedIndexTypes in DIF Impl module for valid values.
        table - The table that will be indexed
        columns - The list of columns to index. The order is significant
        order - The ascending/descending specification for the sort order
      • dropIndex

        void dropIndex​(com.im.commons.db.ddl.DBIndexInfo index,
                       com.im.commons.progress.DFEnvironmentRW env)
        Drops the specified index. The index name must exist, otherwise an SQLException will be thrown.
        Parameters:
        index - The index to drop
      • rebuildIndex

        void rebuildIndex​(com.im.commons.db.ddl.DBIndexInfo index,
                          com.im.commons.progress.DFEnvironmentRW env)
        Rebuild the specified index. The index name must exist, otherwise an SQLException will be thrown.
        Parameters:
        index - The index to rebuild
      • canBeDropped

        boolean canBeDropped​(com.im.commons.db.ddl.DBIndexInfo index)
        Can the specified index be dropped?
        Parameters:
        index - The index to drop
      • canBeRebuilded

        boolean canBeRebuilded​(com.im.commons.db.ddl.DBIndexInfo index)
        Can the specified index be rebuild?
        Parameters:
        index - The index to rebuild
      • findIndex

        com.im.commons.db.ddl.DBIndexInfo findIndex​(com.im.commons.db.ddl.DBTableInfo table,
                                                    java.util.List<java.lang.String> columns)
        Will try to find and return indexes for the columns provided. Column order is important
        Parameters:
        table - The table whose columns are indexed
        columns - The list of indexed columns
        Returns:
        DFIndexInfo for the index found, or null if no such index exists.