com.triactive.jdo.store.sql
Class ClassView

java.lang.Object
  extended by com.triactive.jdo.store.sql.View
      extended by com.triactive.jdo.store.sql.ClassView
All Implemented Interfaces:
ClassTable, Table

public class ClassView
extends View
implements ClassTable


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
ClassView(TableName name, ClassMetaData cmd, DatabaseAdapter dba)
           
 
Method Summary
 void addColumn(Column col)
           
protected  void assertIsInitialized()
           
protected  void assertIsUninitialized()
           
protected  void assertIsValidated()
           
 boolean equals(java.lang.Object obj)
           
 boolean exists(StoreManager.MgmtTransaction mtx)
          Tests if the database table exists.
 ClassMetaData getClassMetaData()
           
 DatabaseAdapter getDatabaseAdapter()
           
 Mapping getFieldMapping(int fieldNumber)
           
 Mapping getFieldMapping(java.lang.String fieldName)
           
 TableName getName()
           
protected  java.util.List getSqlCreateStatements(StoreManager.MgmtTransaction mtx)
           
 java.lang.Class getType()
           
protected  boolean hasColumnName(ColumnName colName)
           
 int hashCode()
           
 void initialize(StoreManager.MgmtTransaction mtx)
           
 Table intern()
          Returns a canonical representation for the table object.
 boolean isFieldPersistent(int fieldNumber)
           
 boolean isInitialized()
           
 boolean isValidated()
           
 Column newColumn(java.lang.Class type, ColumnName baseColName, Role role)
           
 Column newColumn(java.lang.Class type, java.lang.String javaName)
           
 javax.jdo.Extent newExtent(PersistenceManager pm, boolean subclasses)
           
 OIDGenerator newOIDGenerator(int classID)
           
 java.lang.String toString()
           
 
Methods inherited from class com.triactive.jdo.store.sql.View
create, drop, getSqlDropStatements, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.triactive.jdo.store.sql.Table
addColumn, create, drop, exists, getDatabaseAdapter, getName, intern, isInitialized, isValidated, newColumn, newColumn, validate
 

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

ClassView

public ClassView(TableName name,
                 ClassMetaData cmd,
                 DatabaseAdapter dba)
Method Detail

initialize

public void initialize(StoreManager.MgmtTransaction mtx)
Specified by:
initialize in interface Table
Overrides:
initialize in class View

getType

public java.lang.Class getType()
Specified by:
getType in interface ClassTable

getClassMetaData

public ClassMetaData getClassMetaData()
Specified by:
getClassMetaData in interface ClassTable

newOIDGenerator

public OIDGenerator newOIDGenerator(int classID)
Specified by:
newOIDGenerator in interface ClassTable

isFieldPersistent

public boolean isFieldPersistent(int fieldNumber)
Specified by:
isFieldPersistent in interface ClassTable

getFieldMapping

public Mapping getFieldMapping(int fieldNumber)
Specified by:
getFieldMapping in interface ClassTable

getFieldMapping

public Mapping getFieldMapping(java.lang.String fieldName)
Specified by:
getFieldMapping in interface ClassTable

getSqlCreateStatements

protected java.util.List getSqlCreateStatements(StoreManager.MgmtTransaction mtx)
Overrides:
getSqlCreateStatements in class View

newExtent

public javax.jdo.Extent newExtent(PersistenceManager pm,
                                  boolean subclasses)
Specified by:
newExtent in interface ClassTable

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

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

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object


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