com.jgpruitt.datamodeler.core
Class PrimaryKey

java.lang.Object
  extended by com.jgpruitt.datamodeler.core.ColumnSet
      extended by com.jgpruitt.datamodeler.core.PrimaryKey
All Implemented Interfaces:
java.lang.Iterable<Column>

public class PrimaryKey
extends ColumnSet

This class models a primary key constraint on a database table.

Author:
John Pruitt
See Also:
Table

Field Summary
protected  java.lang.String comment
           
protected  java.lang.String name
           
protected  Table table
           
 
Fields inherited from class com.jgpruitt.datamodeler.core.ColumnSet
list, map
 
Constructor Summary
PrimaryKey(java.lang.String name)
          Constructor
 
Method Summary
 java.lang.String getComment()
          Gets the comment describing the ForeignKey
 java.lang.String getName()
          Gets the name of the PrimaryKey
 Table getTable()
          Gets the Table being constrained
 void setComment(java.lang.String comment)
          Sets the comment describing the ForeignKey
 void setTable(Table table)
          Sets the Table being constrained by the constraint
 
Methods inherited from class com.jgpruitt.datamodeler.core.ColumnSet
add, contains, contains, get, get, isEmpty, iterator, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final java.lang.String name

table

protected Table table

comment

protected java.lang.String comment
Constructor Detail

PrimaryKey

public PrimaryKey(java.lang.String name)
Constructor

Parameters:
name - the name of the PrimaryKey
Method Detail

getName

public java.lang.String getName()
Gets the name of the PrimaryKey

Returns:
the name

getTable

public Table getTable()
Gets the Table being constrained

Returns:
the Table

setTable

public void setTable(Table table)
Sets the Table being constrained by the constraint

Parameters:
table - the Table being constrained

getComment

public java.lang.String getComment()
Gets the comment describing the ForeignKey

Returns:
the comment

setComment

public void setComment(java.lang.String comment)
Sets the comment describing the ForeignKey

Parameters:
comment - the Comment