org.apache.empire.db
Class DBExpressionIndex

java.lang.Object
  extended by org.apache.empire.db.DBObject
      extended by org.apache.empire.db.DBIndex
          extended by org.apache.empire.db.DBExpressionIndex
All Implemented Interfaces:
Serializable

public class DBExpressionIndex
extends DBIndex

This class handles the primary key for the tables. The primary key contains one or more columns.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.empire.db.DBIndex
PRIMARYKEY, STANDARD, UNIQUE
 
Constructor Summary
DBExpressionIndex(String name, boolean unique, DBColumnExpr expr)
          Constructs a DBExpresionIndex
DBExpressionIndex(String name, boolean unique, DBExpr... columnExpressions)
          Constructs a DBExpresionIndex
 
Method Summary
 boolean contains(DBColumn col)
          Checks if this index contains the column col
 int getColumnPos(DBColumn col)
          Gets the position of a specified DBColumn object.
 DBDatabase getDatabase()
          Returns the database object to which this object belongs to.
 DBExpr[] getExpressions()
          Returns the columnExpressions belonging to this index.
 
Methods inherited from class org.apache.empire.db.DBIndex
getColumns, getFullName, getName, getTable, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBExpressionIndex

public DBExpressionIndex(String name,
                         boolean unique,
                         DBExpr... columnExpressions)
Constructs a DBExpresionIndex

Parameters:
name - the index name
unique - true if the index has only unique values or false otherwise
columnExpressions - an array of one or more column expressions of the index

DBExpressionIndex

public DBExpressionIndex(String name,
                         boolean unique,
                         DBColumnExpr expr)
Constructs a DBExpresionIndex

Parameters:
name - the index name
unique - true if the index has only unique values or false otherwise
expr - an column expressions that defines the key values for the index
Method Detail

getDatabase

public 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 DBExpr[] 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


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.