com.triactive.jdo.store.sql
Interface Table

All Known Subinterfaces:
ClassTable
All Known Implementing Classes:
com.triactive.jdo.store.sql.AbstractTable, ClassBaseTable, ClassView

public interface Table


Field Summary
static int TABLE_TYPE_BASE_TABLE
          Returned by MgmtTransaction.getTableType() if the table is a base table.
static int TABLE_TYPE_MISSING
          Returned by MgmtTransaction.getTableType() if the table does not exist.
static int TABLE_TYPE_UNKNOWN
          Returned by MgmtTransaction.getTableType() if the table type is not recognized.
static int TABLE_TYPE_VIEW
          Returned by MgmtTransaction.getTableType() if the table is a view.
 
Method Summary
 void addColumn(Column col)
           
 void create(StoreManager.MgmtTransaction mtx)
           
 void drop(StoreManager.MgmtTransaction mtx)
           
 boolean exists(StoreManager.MgmtTransaction mtx)
          Tests if the database table exists.
 DatabaseAdapter getDatabaseAdapter()
           
 TableName getName()
           
 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 baseName, Role role)
           
 Column newColumn(java.lang.Class type, java.lang.String javaName)
           
 boolean validate(StoreManager.MgmtTransaction mtx)
           
 

Field Detail

TABLE_TYPE_MISSING

public static final int TABLE_TYPE_MISSING
Returned by MgmtTransaction.getTableType() if the table does not exist.

See Also:
Constant Field Values

TABLE_TYPE_UNKNOWN

public static final int TABLE_TYPE_UNKNOWN
Returned by MgmtTransaction.getTableType() if the table type is not recognized.

See Also:
Constant Field Values

TABLE_TYPE_BASE_TABLE

public static final int TABLE_TYPE_BASE_TABLE
Returned by MgmtTransaction.getTableType() if the table is a base table.

See Also:
Constant Field Values

TABLE_TYPE_VIEW

public static final int TABLE_TYPE_VIEW
Returned by MgmtTransaction.getTableType() if the table is a view.

See Also:
Constant Field Values
Method Detail

initialize

public void initialize(StoreManager.MgmtTransaction mtx)

isInitialized

public boolean isInitialized()

getName

public TableName getName()

getDatabaseAdapter

public DatabaseAdapter getDatabaseAdapter()

addColumn

public void addColumn(Column col)

newColumn

public Column newColumn(java.lang.Class type,
                        java.lang.String javaName)

newColumn

public Column newColumn(java.lang.Class type,
                        ColumnName baseName,
                        Role role)

intern

public Table intern()
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.

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
Tests if the database table exists.

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

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

isValidated

public boolean isValidated()

drop

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


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