org.axiondb.constraints
Class UniqueConstraint

java.lang.Object
  extended by org.axiondb.constraints.BaseConstraint
      extended by org.axiondb.constraints.BaseSelectableBasedConstraint
          extended by org.axiondb.constraints.UniqueConstraint
All Implemented Interfaces:
java.io.Serializable, Constraint, SelectableBasedConstraint
Direct Known Subclasses:
PrimaryKeyConstraint

public class UniqueConstraint
extends BaseSelectableBasedConstraint

A UNIQUE constraint, which is violated when my collection of Selectables is not unique within my table.

Version:
$Revision: 1.16 $ $Date: 2007/11/13 19:04:02 $
See Also:
Serialized Form

Constructor Summary
UniqueConstraint(java.lang.String name)
           
UniqueConstraint(java.lang.String name, java.lang.String type)
           
 
Method Summary
 void addFK(java.lang.String name)
           
 boolean evaluate(RowEvent event)
          Evaluate the given event under me.
 boolean evaluate(RowEvent event, RowDecorator dec)
          Evaluate the given event under me.
 boolean evaluate(RowEvent event, RowDecorator dec, boolean wasDeferred)
           
 boolean evaluate(RowIterator oldRows, RowIterator newRows, Table table)
           
 java.util.Iterator getFKs()
           
 
Methods inherited from class org.axiondb.constraints.BaseSelectableBasedConstraint
addSelectable, getSelectable, getSelectableCount, getSelectableList, getSelectables, resolve
 
Methods inherited from class org.axiondb.constraints.BaseConstraint
getName, getType, isDeferrable, isDeferred, setDeferrable, setDeferred, setName, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axiondb.Constraint
getName, getType, isDeferrable, isDeferred, setDeferrable, setDeferred, setName
 

Constructor Detail

UniqueConstraint

public UniqueConstraint(java.lang.String name)

UniqueConstraint

public UniqueConstraint(java.lang.String name,
                        java.lang.String type)
Method Detail

evaluate

public boolean evaluate(RowEvent event)
                 throws AxionException
Description copied from interface: Constraint
Evaluate the given event under me. Returns false if the constraint I represent has been violated.

Specified by:
evaluate in interface Constraint
Specified by:
evaluate in class BaseSelectableBasedConstraint
Throws:
AxionException

evaluate

public boolean evaluate(RowEvent event,
                        RowDecorator dec)
                 throws AxionException
Description copied from interface: Constraint
Evaluate the given event under me. Returns false if the constraint I represent has been violated.

Specified by:
evaluate in interface Constraint
Specified by:
evaluate in class BaseSelectableBasedConstraint
Throws:
AxionException

evaluate

public boolean evaluate(RowEvent event,
                        RowDecorator dec,
                        boolean wasDeferred)
                 throws AxionException
Throws:
AxionException

evaluate

public boolean evaluate(RowIterator oldRows,
                        RowIterator newRows,
                        Table table)
                 throws AxionException
Specified by:
evaluate in interface Constraint
Specified by:
evaluate in class BaseSelectableBasedConstraint
Throws:
AxionException

addFK

public void addFK(java.lang.String name)

getFKs

public java.util.Iterator getFKs()