com.im.df.api 5.9

com.im.df.api.capabilities
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.


Method Summary
 boolean canBeDropped(DBIndexInfo index)
          Can the specified index be dropped?
 boolean canBeRebuilded(DBIndexInfo index)
          Can the specified index be rebuild?
 void createIndex(String index, String indexType, DBTableInfo table, List<String> columns, List<Boolean> order, DFEnvironmentRW env)
          Creates an index over the specified table of the given type.
 void dropIndex(DBIndexInfo index, DFEnvironmentRW env)
          Drops the specified index.
 DBIndexInfo findIndex(DBTableInfo table, List<String> columns)
          Will try to find and return indexes for the columns provided.
 void rebuildIndex(DBIndexInfo index, DFEnvironmentRW env)
          Rebuild the specified index.
 

Method Detail

createIndex

void createIndex(String index,
                 String indexType,
                 DBTableInfo table,
                 List<String> columns,
                 List<Boolean> order,
                 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(DBIndexInfo index,
               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(DBIndexInfo index,
                  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(DBIndexInfo index)
Can the specified index be dropped?

Parameters:
index - The index to drop

canBeRebuilded

boolean canBeRebuilded(DBIndexInfo index)
Can the specified index be rebuild?

Parameters:
index - The index to rebuild

findIndex

DBIndexInfo findIndex(DBTableInfo table,
                      List<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.

com.im.df.api 5.9