Quadcap Embeddable Database

com.quadcap.sql.View Class Reference

Inheritance diagram for com.quadcap.sql.View:

com.quadcap.sql.TupleImpl com.quadcap.sql.Relation Externalizable com.quadcap.sql.Tuple Externalizable com.quadcap.sql.Tuple List of all members.

Detailed Description

A SQL VIEW.

Author:
Stan Bailes

Definition at line 64 of file View.java.

Public Member Functions

 View ()
 Default constructor.

 View (String name, Vector columns, TableExpression select, int check)
 Explicit constructor from name, columns, select expression, VIEW CHECK state.

void addColumns (Session session) throws SQLException
 Lazy build the view's columns list.

void checkRow (Session session, Cursor cursor, Row row) throws SQLException
 Check a base row to see if it's contained in the view.

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

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

Cursor getCursor (Session session, Expression where, String asName, Cursor cursor) throws SQLException
 Get the view's cursor.

void insertRow (Session session, Row row) throws SQLException, IOException
boolean isUpdatable ()
boolean hasBlobs ()
Vector getBaseTables ()
Expression getViewExpression ()
String getType ()
void delete (Session session)
String toString ()
 Return a string representation for debugging.


Package Attributes

Vector viewColumns
TableExpression select
int check

Static Package Attributes

final int NOCHECK = -1
final int CASCADED = 0
final int LOCAL = 1


Constructor & Destructor Documentation

com.quadcap.sql.View.View  ) 
 

Default constructor.

Definition at line 77 of file View.java.

com.quadcap.sql.View.View String  name,
Vector  columns,
TableExpression  select,
int  check
 

Explicit constructor from name, columns, select expression, VIEW CHECK state.

Definition at line 83 of file View.java.


Member Function Documentation

void com.quadcap.sql.View.addColumns Session  session  )  throws SQLException
 

Lazy build the view's columns list.

Definition at line 95 of file View.java.

References com.quadcap.sql.View.addColumns(), com.quadcap.sql.Cursor.close(), and com.quadcap.sql.View.getCursor().

Referenced by com.quadcap.sql.View.addColumns(), com.quadcap.sql.StmtCreateView.execute(), and com.quadcap.sql.StmtCreateView.redo().

void com.quadcap.sql.View.checkRow Session  session,
Cursor  cursor,
Row  row
throws SQLException
 

Check a base row to see if it's contained in the view.

Definition at line 109 of file View.java.

References com.quadcap.sql.View.check, com.quadcap.sql.View.checkRow(), com.quadcap.sql.Expression.getValue(), com.quadcap.sql.TableExpression.getWhere(), com.quadcap.sql.types.Value.isTrue(), com.quadcap.sql.TableExpression.isUpdatable(), com.quadcap.sql.StaticCursor.next(), com.quadcap.sql.View.NOCHECK, and com.quadcap.sql.View.select.

Referenced by com.quadcap.sql.View.checkRow(), com.quadcap.sql.ViewCursor.insertRow(), and com.quadcap.sql.ViewCursor.updateRow().

void com.quadcap.sql.View.delete Session  session  ) 
 

Definition at line 222 of file View.java.

Vector com.quadcap.sql.View.getBaseTables  ) 
 

Definition at line 210 of file View.java.

References com.quadcap.sql.TableExpression.getBaseTables(), and com.quadcap.sql.View.select.

Referenced by com.quadcap.sql.StmtCreateView.redo().

Cursor com.quadcap.sql.View.getCursor Session  session,
Expression  where,
String  asName,
Cursor  cursor
throws SQLException
 

Get the view's cursor.

Implements com.quadcap.sql.Relation.

Definition at line 152 of file View.java.

References com.quadcap.sql.Tuple.getColumn(), com.quadcap.sql.Tuple.getColumnCount(), com.quadcap.sql.TableExpression.getCursor(), com.quadcap.sql.View.getCursor(), com.quadcap.sql.Column.getName(), com.quadcap.sql.TupleImpl.getName(), com.quadcap.sql.View.select, and com.quadcap.sql.View.viewColumns.

Referenced by com.quadcap.sql.View.addColumns(), and com.quadcap.sql.View.getCursor().

String com.quadcap.sql.View.getType  ) 
 

Implements com.quadcap.sql.Relation.

Definition at line 220 of file View.java.

Expression com.quadcap.sql.View.getViewExpression  ) 
 

Definition at line 216 of file View.java.

References com.quadcap.sql.View.select.

Referenced by com.quadcap.sql.StmtRenameTable.renameView().

boolean com.quadcap.sql.View.hasBlobs  ) 
 

Implements com.quadcap.sql.Relation.

Definition at line 206 of file View.java.

void com.quadcap.sql.View.insertRow Session  session,
Row  row
throws SQLException, IOException
 

Implements com.quadcap.sql.Relation.

Definition at line 190 of file View.java.

References com.quadcap.sql.Cursor.close(), com.quadcap.sql.Cursor.insertRow(), and com.quadcap.sql.View.insertRow().

Referenced by com.quadcap.sql.View.insertRow().

boolean com.quadcap.sql.View.isUpdatable  ) 
 

Implements com.quadcap.sql.Relation.

Definition at line 202 of file View.java.

References com.quadcap.sql.TableExpression.isUpdatable(), and com.quadcap.sql.View.select.

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

Externalizable.readExternal(): Read me from a stream.

Reimplemented from com.quadcap.sql.TupleImpl.

Definition at line 130 of file View.java.

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

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

String com.quadcap.sql.View.toString  ) 
 

Return a string representation for debugging.

Reimplemented from com.quadcap.sql.TupleImpl.

Definition at line 224 of file View.java.

References com.quadcap.sql.TupleImpl.getName(), com.quadcap.sql.Column.getShortName(), com.quadcap.sql.View.select, and com.quadcap.sql.Expression.toString().

Referenced by com.quadcap.sql.StmtCreateView.toString().

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

Externalizable.writeExternal(): Write me to a stream.

Reimplemented from com.quadcap.sql.TupleImpl.

Definition at line 142 of file View.java.

References com.quadcap.sql.View.check, com.quadcap.sql.View.select, com.quadcap.sql.View.viewColumns, and com.quadcap.sql.View.writeExternal().

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


Member Data Documentation

final int com.quadcap.sql.View.CASCADED = 0 [static, package]
 

Definition at line 69 of file View.java.

int com.quadcap.sql.View.check [package]
 

Definition at line 72 of file View.java.

Referenced by com.quadcap.sql.View.checkRow(), and com.quadcap.sql.View.writeExternal().

final int com.quadcap.sql.View.LOCAL = 1 [static, package]
 

Definition at line 70 of file View.java.

final int com.quadcap.sql.View.NOCHECK = -1 [static, package]
 

Definition at line 68 of file View.java.

Referenced by com.quadcap.sql.View.checkRow().

TableExpression com.quadcap.sql.View.select [package]
 

Definition at line 66 of file View.java.

Referenced by com.quadcap.sql.View.checkRow(), com.quadcap.sql.View.getBaseTables(), com.quadcap.sql.View.getCursor(), com.quadcap.sql.View.getViewExpression(), com.quadcap.sql.View.isUpdatable(), com.quadcap.sql.View.toString(), and com.quadcap.sql.View.writeExternal().

Vector com.quadcap.sql.View.viewColumns [package]
 

Definition at line 65 of file View.java.

Referenced by com.quadcap.sql.View.getCursor(), and com.quadcap.sql.View.writeExternal().