SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

kodo.jdbc.schema
Class PrimaryKey

java.lang.Object
  |
  +--kodo.jdbc.schema.ReferenceCounter
        |
        +--kodo.jdbc.schema.Constraint
              |
              +--kodo.jdbc.schema.PrimaryKey

public class PrimaryKey
extends Constraint

Represents a table primary key. This class is closely aligned with the key information available from DatabaseMetaData.


Constructor Summary
PrimaryKey()
          Default constructor.
PrimaryKey(String name, Table table)
          Constructor.
 
Method Summary
 void addColumn(Column col)
          Add a column to the primary key.
 boolean columnsMatch(Column[] pkCols)
          Return true if the given columns match the columns of this key.
 boolean containsColumn(Column col)
          Return true if the pk includes the given column.
 void derefColumns()
          Deref all columns in this key.
 boolean equalsPrimaryKey(PrimaryKey pk)
          Return true if the structure of this primary key matches that of the given one (same table, same columns).
 Column[] getColumns()
          Return all the columns the primary key spans.
 boolean isLogical()
          Return whether this constraint is a logical constraint only; i.e.
 void refColumns()
          Ref all columns in this key.
 boolean removeColumn(Column col)
          Remove a column from the primary key.
 void setColumns(Column[] cols)
          Set the columns the primary key spans.
 void setLogical(boolean logical)
           
 
Methods inherited from class kodo.jdbc.schema.Constraint
deref, getColumnName, getFullName, getName, getRefCount, getSchemaName, getTable, getTableName, isDeferred, ref, setColumnName, setDeferred, setName, setSchemaName, setTableName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrimaryKey

public PrimaryKey()
Default constructor.

PrimaryKey

public PrimaryKey(String name,
                  Table table)
Constructor.
Parameters:
name - the name of the primary key, if any
table - the table of the primary key
Method Detail

isLogical

public boolean isLogical()
Description copied from class: Constraint
Return whether this constraint is a logical constraint only; i.e. if it does not exist in the database.
Overrides:
isLogical in class Constraint

setLogical

public void setLogical(boolean logical)

getColumns

public Column[] getColumns()
Return all the columns the primary key spans.

setColumns

public void setColumns(Column[] cols)
Set the columns the primary key spans.

addColumn

public void addColumn(Column col)
Add a column to the primary key.

removeColumn

public boolean removeColumn(Column col)
Remove a column from the primary key.
Returns:
true if the column was removed, false if not part of the primary key

containsColumn

public boolean containsColumn(Column col)
Return true if the pk includes the given column.

refColumns

public void refColumns()
Ref all columns in this key.

derefColumns

public void derefColumns()
Deref all columns in this key.

equalsPrimaryKey

public boolean equalsPrimaryKey(PrimaryKey pk)
Return true if the structure of this primary key matches that of the given one (same table, same columns).

columnsMatch

public boolean columnsMatch(Column[] pkCols)
Return true if the given columns match the columns of this key.

SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.