Class DBExpressionIndex


public class DBExpressionIndex extends DBIndex
This class allows to create an expression based index
  • Constructor Details

    • DBExpressionIndex

      public DBExpressionIndex(String name, DBIndex.DBIndexType type, DBColumnExpr... columnExpressions)
      Constructs a DBExpresionIndex
      Parameters:
      name - the index name
      type - the index type
      columnExpressions - an array of one or more column expressions of the index
    • DBExpressionIndex

      public DBExpressionIndex(String name, boolean unique, DBColumnExpr... columnExpressions)
      Constructs a DBExpresionIndex
      Parameters:
      name - the index name
      unique - flag whether the index is unique
      columnExpressions - the index columns Overload for convenience
  • Method Details

    • getDatabase

      public final DBDatabase getDatabase()
      Description copied from class: DBObject
      Returns the database object to which this object belongs to. For the database object itself this function will return the this pointer.
      Overrides:
      getDatabase in class DBIndex
      Returns:
      the database object
    • getExpressions

      public DBColumnExpr[] getExpressions()
      Returns the columnExpressions belonging to this index.
      Overrides:
      getExpressions in class DBIndex
      Returns:
      the columnExpressions belonging to this index
    • contains

      public boolean contains(DBColumn col)
      Checks if this index contains the column col
      Overrides:
      contains in class DBIndex
      Parameters:
      col - the column
      Returns:
      true if this index contains this column
    • getColumnPos

      public int getColumnPos(DBColumn col)
      Gets the position of a specified DBColumn object.
      Overrides:
      getColumnPos in class DBIndex
      Parameters:
      col - the column
      Returns:
      the position or -1 if the column was not found