Quadcap Embeddable Database

com.quadcap.sql.NotNullConstraint Class Reference

Inheritance diagram for com.quadcap.sql.NotNullConstraint:

com.quadcap.sql.Constraint Externalizable Externalizable List of all members.

Detailed Description

Constraint implementation of NOT NULL.

Author:
Stan Bailes

Definition at line 60 of file NotNullConstraint.java.

Public Member Functions

 NotNullConstraint ()
 NotNullConstraint (String name)
 NotNullConstraint (String name, Vector names)
void add (Session session)
 Called when the constraint is added.

void checkInsert (Session session, Row row) throws SQLException, IOException
 ---INSERT Called before a row is INSERTED, with an opportunity to signal a constraint violation if one can be detected.

void applyInsert (Session session, Row row, long rowId, Constraint activeIndex) throws SQLException, IOException
 Called after the specified row has been inserted, with the resulting row ID, and with the active index.

void checkUpdate (Session session, byte[] oldKey, Row row, Row oldRow, long rowId, Constraint activeIndex) throws SQLException, IOException
 ----UPDATE Called before a row is UPDATED, with an opportunity to signal a constraint violation if one can be detected.

void applyUpdate (Session session, byte[] oldKey, Row row, Row oldRow, long rowId, Constraint activeIndex) throws SQLException, IOException
 Called after a row has been updated, with the old row, old key, new row and row ID.

void checkDelete (Session session, Row row, long rowId) throws SQLException, IOException
 ----DELETE Called before a row is DELETED, with an opportunity to signal a constraint violation if one can be detected.

void applyDelete (Session session, Row row, long rowId, Constraint activeIndex) throws SQLException, IOException
 Called after a row has been deleted, with the old row and row ID.

void delete (Session session)
 Called when the constraint itself is being removed.

void readExternal (ObjectInput in) throws IOException, ClassNotFoundException
 Read me from a stream.

void writeExternal (ObjectOutput out) throws IOException
 Write me to a stream.

void setTable (Table t) throws SQLException
 Set the contstraint's table.


Constructor & Destructor Documentation

com.quadcap.sql.NotNullConstraint.NotNullConstraint  ) 
 

Definition at line 61 of file NotNullConstraint.java.

com.quadcap.sql.NotNullConstraint.NotNullConstraint String  name  ) 
 

Definition at line 63 of file NotNullConstraint.java.

com.quadcap.sql.NotNullConstraint.NotNullConstraint String  name,
Vector  names
 

Definition at line 67 of file NotNullConstraint.java.


Member Function Documentation

void com.quadcap.sql.NotNullConstraint.add Session  session  )  [virtual]
 

Called when the constraint is added.

Constraints which maintain state (e.g., indexes) can build their initial data structures (or whatever it is that they do at this time)

Implements com.quadcap.sql.Constraint.

Definition at line 71 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.add().

Referenced by com.quadcap.sql.NotNullConstraint.add().

void com.quadcap.sql.NotNullConstraint.applyDelete Session  session,
Row  row,
long  rowId,
Constraint  activeIndex
throws SQLException, IOException [virtual]
 

Called after a row has been deleted, with the old row and row ID.

Constraints which maintain state (such as an index) would extend this class and implement this method to update the index.

Implements com.quadcap.sql.Constraint.

Definition at line 114 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.applyDelete().

Referenced by com.quadcap.sql.NotNullConstraint.applyDelete().

void com.quadcap.sql.NotNullConstraint.applyInsert Session  session,
Row  row,
long  rowId,
Constraint  activeIndex
throws SQLException, IOException [virtual]
 

Called after the specified row has been inserted, with the resulting row ID, and with the active index.

Constraints which maintain state (such as an index) would extend this class and implement this method to update the index

Implements com.quadcap.sql.Constraint.

Definition at line 90 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.applyInsert().

Referenced by com.quadcap.sql.NotNullConstraint.applyInsert().

void com.quadcap.sql.NotNullConstraint.applyUpdate Session  session,
byte[]  oldKey,
Row  row,
Row  oldRow,
long  rowId,
Constraint  activeIndex
throws SQLException, IOException [virtual]
 

Called after a row has been updated, with the old row, old key, new row and row ID.

Constraints which maintain state (such as an index) would extend this class and implement this method to update the index.

Implements com.quadcap.sql.Constraint.

Definition at line 103 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.applyUpdate().

Referenced by com.quadcap.sql.NotNullConstraint.applyUpdate().

void com.quadcap.sql.NotNullConstraint.checkDelete Session  session,
Row  row,
long  rowId
throws SQLException, IOException [virtual]
 

----DELETE Called before a row is DELETED, with an opportunity to signal a constraint violation if one can be detected.

Implements com.quadcap.sql.Constraint.

Definition at line 109 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.checkDelete().

Referenced by com.quadcap.sql.NotNullConstraint.checkDelete().

void com.quadcap.sql.NotNullConstraint.checkInsert Session  session,
Row  row
throws SQLException, IOException [virtual]
 

---INSERT Called before a row is INSERTED, with an opportunity to signal a constraint violation if one can be detected.

Implements com.quadcap.sql.Constraint.

Definition at line 74 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.checkInsert(), com.quadcap.sql.TupleImpl.getColumn(), com.quadcap.sql.Constraint.getColumns(), com.quadcap.sql.TupleImpl.getName(), and com.quadcap.sql.Column.getShortName().

Referenced by com.quadcap.sql.NotNullConstraint.checkInsert().

void com.quadcap.sql.NotNullConstraint.checkUpdate Session  session,
byte[]  oldKey,
Row  row,
Row  oldRow,
long  rowId,
Constraint  activeIndex
throws SQLException, IOException [virtual]
 

----UPDATE Called before a row is UPDATED, with an opportunity to signal a constraint violation if one can be detected.

Because the oldRow may be 'lazy', it's important to instantiate whatever items are going to be needed later by applyUpdate *now*, otherwise, apply may get the 'new' versions of those items, because the underlying byte stream is modified by the time applyUpdate gets called.

Implements com.quadcap.sql.Constraint.

Definition at line 96 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.checkUpdate().

Referenced by com.quadcap.sql.NotNullConstraint.checkUpdate().

void com.quadcap.sql.NotNullConstraint.delete Session  session  )  [virtual]
 

Called when the constraint itself is being removed.

Constraints which allocate resources of any kind should release them here since they are about to be discarded and gc'ed.

Implements com.quadcap.sql.Constraint.

Definition at line 120 of file NotNullConstraint.java.

void com.quadcap.sql.NotNullConstraint.readExternal ObjectInput  in  )  throws IOException, ClassNotFoundException
 

Read me from a stream.

Reimplemented from com.quadcap.sql.Constraint.

Definition at line 122 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.readExternal().

Referenced by com.quadcap.sql.NotNullConstraint.readExternal().

void com.quadcap.sql.NotNullConstraint.setTable Table  t  )  throws SQLException
 

Set the contstraint's table.

Reimplemented from com.quadcap.sql.Constraint.

Definition at line 132 of file NotNullConstraint.java.

References com.quadcap.sql.Constraint.getColumns(), and com.quadcap.sql.NotNullConstraint.setTable().

Referenced by com.quadcap.sql.NotNullConstraint.setTable().

void com.quadcap.sql.NotNullConstraint.writeExternal ObjectOutput  out  )  throws IOException
 

Write me to a stream.

Reimplemented from com.quadcap.sql.Constraint.

Definition at line 128 of file NotNullConstraint.java.

References com.quadcap.sql.NotNullConstraint.writeExternal().

Referenced by com.quadcap.sql.NotNullConstraint.writeExternal().