org.axiondb
Interface Constraint

All Superinterfaces:
Serializable
All Known Subinterfaces:
SelectableBasedConstraint
All Known Implementing Classes:
BaseConstraint, BaseSelectableBasedConstraint, CheckConstraint, ForeignKeyConstraint, NotNullConstraint, NullConstraint, PrimaryKeyConstraint, UniqueConstraint

public interface Constraint
extends Serializable

A database constraint, such as UNIQUE or NOT NULL.

Version:
$Revision: 1.16 $ $Date: 2005/12/20 18:32:40 $

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)
           
 String getName()
          Get my name.
 String getType()
          Get a human-readable descrption of the type of constraint I represent.
 boolean isDeferrable()
          Return whether or not I am deferrable.
 boolean isDeferred()
          Return whether or not I am deferred.
 void resolve(Database db, TableIdentifier table)
          Resolve any unresolved org.axiondb.Selectableidentifiers I may have.
 void setDeferrable(boolean deferrable)
          Set whether or not I am deferrable.
 void setDeferred(boolean deferred)
          Set whether or not I am deferred.
 void setName(String name)
          Set my name.
 

Method Detail

evaluate

boolean evaluate(RowEvent event)
                 throws AxionException
Evaluate the given event under me. Returns false if the constraint I represent has been violated.

Throws:
AxionException

evaluate

boolean evaluate(RowEvent event,
                 RowDecorator dec)
                 throws AxionException
Evaluate the given event under me. Returns false if the constraint I represent has been violated.

Throws:
AxionException

evaluate

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

getName

String getName()
Get my name.


getType

String getType()
Get a human-readable descrption of the type of constraint I represent.


isDeferrable

boolean isDeferrable()
Return whether or not I am deferrable.


isDeferred

boolean isDeferred()
Return whether or not I am deferred. Deferred constraints are not evaluated until the transaction is committed.


resolve

void resolve(Database db,
             TableIdentifier table)
             throws AxionException
Resolve any unresolved org.axiondb.Selectableidentifiers I may have.

Throws:
AxionException

setDeferrable

void setDeferrable(boolean deferrable)
Set whether or not I am deferrable.


setDeferred

void setDeferred(boolean deferred)
                 throws AxionException
Set whether or not I am deferred. Deferred constraints are not evaluated until the transaction is committed. Throws an exception if I am not deferrableand deferred is true.

Throws:
AxionException

setName

void setName(String name)
Set my name.