org.axiondb.constraints
Class CheckConstraint

java.lang.Object
  extended by org.axiondb.constraints.BaseConstraint
      extended by org.axiondb.constraints.CheckConstraint
All Implemented Interfaces:
java.io.Serializable, Constraint

public class CheckConstraint
extends BaseConstraint

A CHECK constraint, which is violated whenever the given conditionis violated.

Version:
$Revision: 1.17 $ $Date: 2005/12/20 18:32:46 $
See Also:
Serialized Form

Constructor Summary
CheckConstraint(java.lang.String name)
           
 
Method Summary
 boolean evaluate(RowEvent event)
          Evaluate the given event under me.
 boolean evaluate(RowEvent event, RowDecorator dec)
          Evaluate the given event under me.
 boolean evaluate(RowIterator oldRows, RowIterator newRows, Table table)
           
 Selectable getCondition()
           
 void resolve(Database db, TableIdentifier table)
          This base implementation is a no-op.
 void setCondition(Selectable where)
           
 
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
 

Constructor Detail

CheckConstraint

public CheckConstraint(java.lang.String name)
Method Detail

setCondition

public void setCondition(Selectable where)

getCondition

public Selectable getCondition()

resolve

public void resolve(Database db,
                    TableIdentifier table)
             throws AxionException
Description copied from class: BaseConstraint
This base implementation is a no-op.

Specified by:
resolve in interface Constraint
Overrides:
resolve in class BaseConstraint
Throws:
AxionException

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 BaseConstraint
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.

Throws:
AxionException

evaluate

public boolean evaluate(RowIterator oldRows,
                        RowIterator newRows,
                        Table table)
                 throws AxionException
Throws:
AxionException