com.triactive.jdo.store.sql
Class View

java.lang.Object
  extended bycom.triactive.jdo.store.sql.AbstractTable
      extended bycom.triactive.jdo.store.sql.View
All Implemented Interfaces:
Table
Direct Known Subclasses:
ClassView

public class View
extends com.triactive.jdo.store.sql.AbstractTable


Field Summary
protected  java.util.Map columnsByName
           
protected  DatabaseAdapter dba
           
protected  TableName name
           
protected  int state
           
protected static int TABLE_STATE_INITIALIZED
           
protected static int TABLE_STATE_NEW
           
protected static int TABLE_STATE_VALIDATED
           
 
Fields inherited from interface com.triactive.jdo.store.sql.Table
TABLE_TYPE_BASE_TABLE, TABLE_TYPE_MISSING, TABLE_TYPE_UNKNOWN, TABLE_TYPE_VIEW
 
Constructor Summary
View(TableName name, DatabaseAdapter dba)
           
 
Method Summary
 void addColumn(Column col)
           
protected  void assertIsInitialized()
           
protected  void assertIsUninitialized()
           
protected  void assertIsValidated()
           
 void create(StoreManager.MgmtTransaction mtx)
           
 void drop(StoreManager.MgmtTransaction mtx)
           
 boolean equals(java.lang.Object obj)
           
 boolean exists(StoreManager.MgmtTransaction mtx)
          Tests if the database table exists.
 DatabaseAdapter getDatabaseAdapter()
           
 TableName getName()
           
protected  java.util.List getSqlCreateStatements(StoreManager.MgmtTransaction mtx)
           
protected  java.util.List getSqlDropStatements(StoreManager.MgmtTransaction mtx)
           
protected  boolean hasColumnName(ColumnName colName)
           
 int hashCode()
           
 void initialize(StoreManager.MgmtTransaction mtx)
           
 Table intern()
          Returns a canonical representation for the table object.
 boolean isInitialized()
           
 boolean isValidated()
           
 Column newColumn(java.lang.Class type, ColumnName baseColName, Role role)
           
 Column newColumn(java.lang.Class type, java.lang.String javaName)
           
 java.lang.String toString()
           
 boolean validate(StoreManager.MgmtTransaction mtx)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_STATE_NEW

protected static final int TABLE_STATE_NEW
See Also:
Constant Field Values

TABLE_STATE_INITIALIZED

protected static final int TABLE_STATE_INITIALIZED
See Also:
Constant Field Values

TABLE_STATE_VALIDATED

protected static final int TABLE_STATE_VALIDATED
See Also:
Constant Field Values

dba

protected final DatabaseAdapter dba

name

protected final TableName name

state

protected int state

columnsByName

protected java.util.Map columnsByName
Constructor Detail

View

public View(TableName name,
            DatabaseAdapter dba)
Method Detail

initialize

public void initialize(StoreManager.MgmtTransaction mtx)

create

public void create(StoreManager.MgmtTransaction mtx)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

validate

public boolean validate(StoreManager.MgmtTransaction mtx)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

drop

public void drop(StoreManager.MgmtTransaction mtx)
          throws java.sql.SQLException
Throws:
java.sql.SQLException

getSqlCreateStatements

protected java.util.List getSqlCreateStatements(StoreManager.MgmtTransaction mtx)

getSqlDropStatements

protected java.util.List getSqlDropStatements(StoreManager.MgmtTransaction mtx)

getName

public TableName getName()
Specified by:
getName in interface Table

getDatabaseAdapter

public DatabaseAdapter getDatabaseAdapter()
Specified by:
getDatabaseAdapter in interface Table

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Table

isValidated

public boolean isValidated()
Specified by:
isValidated in interface Table

assertIsUninitialized

protected void assertIsUninitialized()

assertIsInitialized

protected void assertIsInitialized()

assertIsValidated

protected void assertIsValidated()

addColumn

public void addColumn(Column col)
Specified by:
addColumn in interface Table

hasColumnName

protected boolean hasColumnName(ColumnName colName)

newColumn

public Column newColumn(java.lang.Class type,
                        java.lang.String javaName)
Specified by:
newColumn in interface Table

newColumn

public Column newColumn(java.lang.Class type,
                        ColumnName baseColName,
                        Role role)
Specified by:
newColumn in interface Table

intern

public Table intern()
Description copied from interface: Table
Returns a canonical representation for the table object.

This method behaves much like String.intern(). A pool of tables, initially empty, is maintained privately.

When the intern method is invoked, if the pool already contains a table equal to this Table object as determined by the equals(Object) method, then the table from the pool is returned. Otherwise, this Table object is added to the pool and a reference to this Table object is returned.

It follows that for any two tables t1 and t2, t1.intern() == t2.intern() is true if and only if t1.equals(t2) is true.

Specified by:
intern in interface Table
Returns:
a table that is equivalent to this table, but is guaranteed to be from a pool of unique tables.

exists

public boolean exists(StoreManager.MgmtTransaction mtx)
               throws java.sql.SQLException
Description copied from interface: Table
Tests if the database table exists.

Specified by:
exists in interface Table
Parameters:
mtx - the active management transaction
Returns:
true if the table exists in the database, false otherwise.
Throws:
java.sql.SQLException

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

toString

public final java.lang.String toString()


Copyright © 2001-2007 The TJDO Project All Rights Reserved.