org.apache.empire.db
Class DBIndex

java.lang.Object
  extended by org.apache.empire.commons.ErrorObject
      extended by org.apache.empire.db.DBObject
          extended by org.apache.empire.db.DBIndex
All Implemented Interfaces:
ErrorInfo

public class DBIndex
extends DBObject

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


Field Summary
static int PRIMARYKEY
           
static int STANDARD
           
static int UNIQUE
           
 
Constructor Summary
DBIndex(java.lang.String name, int type, DBColumn[] columns)
          Constructs a DBIndex object set the specified parameters to this object.
 
Method Summary
 boolean contains(DBColumn col)
          Returns true if a specified DBColumn object exits in the internal DBColumn vector.
 int getColumnPos(DBColumn col)
          Gets the position of a specified DBColumn object.
 DBColumn[] getColumns()
          Returns the columns belonging to this index.
 DBDatabase getDatabase()
          Returns the database object to which this object belongs to.
 java.lang.String getFullName()
          Returns the full qualified table name.
 java.lang.String getName()
          Returns the primary key name.
 int getType()
          Returns the primary key type (only PRIMARYKEY).
 
Methods inherited from class org.apache.empire.commons.ErrorObject
clearError, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, isExceptionsEnabled, setExceptionsEnabled
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD

public static final int STANDARD
See Also:
Constant Field Values

UNIQUE

public static final int UNIQUE
See Also:
Constant Field Values

PRIMARYKEY

public static final int PRIMARYKEY
See Also:
Constant Field Values
Constructor Detail

DBIndex

public DBIndex(java.lang.String name,
               int type,
               DBColumn[] columns)
Constructs a DBIndex object set the specified parameters to this object.

Parameters:
name - the primary key name
type - the primary key type (only PRIMARYKEY)
columns - an array of one or more columns of the primary key
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.

Specified by:
getDatabase in class DBObject
Returns:
the database object

getName

public java.lang.String getName()
Returns the primary key name.

Returns:
the primary key name

getColumns

public DBColumn[] getColumns()
Returns the columns belonging to this index.

Returns:
the columns belonging to this index

getFullName

public java.lang.String getFullName()
Returns the full qualified table name.

Returns:
the full qualified table name

getType

public int getType()
Returns the primary key type (only PRIMARYKEY).


contains

public boolean contains(DBColumn col)
Returns true if a specified DBColumn object exits in the internal DBColumn vector.


getColumnPos

public int getColumnPos(DBColumn col)
Gets the position of a specified DBColumn object.