|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanetj.database.Table
Field Summary | |
static java.lang.String |
className
|
static java.lang.String |
KEY_SEPARATOR
|
Constructor Summary | |
protected |
Table()
Create a mew Table and set its name and Library. |
protected |
Table(java.lang.String pName,
Library library)
Create a mew Table and set its name and Library. |
Method Summary | |
java.lang.StringBuffer |
appendFullyQualifiedName(java.lang.StringBuffer sb)
Appends the library qualified name of the table, such as "mylibrary.mytable" |
static java.lang.StringBuffer |
appendFullyQualifiedName(Table t,
java.lang.StringBuffer sb)
Appends the library qualified name of the table, such as "mylibrary.mytable" |
int |
copyFieldDescriptors(java.lang.String newAlias)
Copies all of this table's FD's into another system alias. |
void |
createFieldDescriptors()
This is to be overridden to allow Table subclasses to create their own unique FieldDescriptors. |
static Table |
createTable(java.lang.String systemAlias,
java.lang.String libName,
java.lang.String tblName)
Creates and returns a new Table using the given system alias, library name, and table name. |
static Table |
createTable(java.lang.String pSystemAlias,
java.lang.String pLibraryName,
java.lang.String pTableName,
java.lang.Class pTableClass)
Creates and returns a new Table using the given system Alias, library name, and table name. |
boolean |
createTableInDB(SQLContext context,
boolean overwrite,
java.util.List fds)
Creates this table in the database specified in the SQLContext. |
java.util.List |
getAllOrderedColumnNames()
Returns a List of column names in this Table. |
java.util.List |
getAllOrderedColumnNames(boolean pDatabaseOnly)
Returns a List of column names in this Table. |
RowCollection |
getAllRows()
Gets all the rows from the table |
java.util.List |
getAutoIncrementFieldDescriptorsA()
Returns a List containing all the FieldDescriptorRow objects which describe Auto-Increment fields in the table |
java.lang.String |
getCreationSQL()
Gets the "CREATE TABLE" SQL statement that can be used to recreate this table. |
java.lang.String |
getCreationSQL(java.lang.String newSystem,
java.lang.String newLibrary,
java.lang.String newTable)
Gets the "CREATE TABLE" SQL statement that can be used to duplicate this table on another system. |
java.lang.String |
getCreationSQL(Table table)
Gets the "CREATE TABLE" SQL statement that can be used to duplicate this table on another system. |
java.lang.String |
getCreationSQL(Table table,
java.util.List fieldDescriptors)
Gets the "CREATE TABLE" SQL statement that can be used to duplicate this table on another system. |
java.lang.String |
getDBLibraryName()
Convience method to get this Table's Library and ask it for its database library name. |
java.util.List |
getFieldDescriptor(java.lang.Class pFldClass)
Returns an IFieldDescriptor for the specified Type |
FieldDescriptorRow |
getFieldDescriptor(java.lang.String fldName)
Returns a FieldDescriptorRow for the specified field name. |
FieldDescriptorCollection |
getFieldDescriptorCollection()
Returns a Map of FieldDescriptors for this table. |
FieldDescriptorCollection |
getFieldDescriptorCollection(boolean pCreate)
Returns a Map of FieldDescriptors for this table. |
java.util.List |
getFieldDescriptorsWithUsageIdOverlap(Table t)
Gets the FD's in this table whose usageids equal the usageids in one or more fields of another table |
java.util.List |
getFieldNames()
Returns a List of Field names in this Table. |
java.lang.String |
getFullyQualifiedName()
Returns the library qualified name of the table, such as "mylibrary.mytable" |
byte[] |
getIPAddress()
Gets the IP address of the system containing this ITable |
java.util.List |
getKeyFieldNames()
Returns a List of names of Fields that are part of the Table's key. |
long |
getLastUpdated()
Gets when this table was last updated by the DataEngine, or when this table's metatdata was last invalidated - whichever is later. |
Library |
getLibrary()
Returns the Library to which this Table belongs to. |
java.lang.String |
getLibraryName()
Returns the name of the Library to which this Table belongs. |
java.util.List |
getLogicalFieldNames()
Returns a List of Field names in this Table. |
long |
getMetadataInvalidationTime()
Gets when this table's metadata was last invalidated. |
java.lang.String |
getMetaDataSystemAlias()
Gets the alias of the system this Table's Library's DBSystem uses for retrieving its meta data. |
java.lang.String |
getName()
Gets the name of this ITable |
java.util.List |
getPhysicalFieldNames()
Returns a List of Field names in this Table. |
PhysicalTable |
getPhysicalTable()
Gets information about the Table's location. |
Row |
getRow(RowKey rowKey)
Reads a row from the this table in the database with the specified key |
java.lang.Class |
getRowClass()
Gets the subclass of Row that should be used for rows read from this table |
DBSystem |
getSystem()
Returns the system of the Library to which this Table belongs. |
java.lang.String |
getSystemAlias()
Returns the system url of the Library to which this Table belongs (the Library gets the url from it's DBSystem). |
java.lang.String |
getSystemURL()
Returns the system url of the Library to which this Table belongs (the Library gets the url from it's DBSystem). |
static Table |
getTable(java.lang.String pSystemAlias,
java.lang.String pLibraryName,
java.lang.String pTableName)
Get the Table for the given table name using the specified library name and system url. |
static Table |
getTable(java.lang.String pSystemAlias,
java.lang.String pLibraryName,
java.lang.String pTableName,
boolean create)
Get the Table for the given table name using the specified library name and system url. |
TableDescriptor |
getTableDescriptor()
Gets the table descriptor |
java.lang.StringBuffer |
getXMLData(java.lang.StringBuffer pXMLData)
This returns a StringBuffer containing all necessary XML data for this object. |
boolean |
isAuthorized(int mode,
ExecutingContext ec)
Tests if the current user is authorized to access this table |
boolean |
isCheckedDataFileForFDs()
Return flag to indicate if Field data file has already been checked for FieldDescriptors. |
boolean |
isExistenceConfirmed()
Return whether or not this Table's existence in the database has been confirmed. |
boolean |
isFDsReadFromDBMetadata()
Return flag to indicate if FD's have been read from the database metadata |
boolean |
isShared()
Tests if this table is a logical "shared" table |
void |
setCheckedDataFileForFDs(boolean pCheckedDataFileForFDs)
Set flag to indicate Field data file has already been checked for FieldDescriptors. |
void |
setFDsReadFromDBMetadata(boolean pAllFDsRead)
Set flag to indicate FDs have been read from DB metadata |
void |
setLastUpdated(long newLastUpdated)
Sets when this table was last updated by DataEngine |
protected void |
setLibrary(Library library)
Sets the Library to which this Table belongs to. |
void |
setMetadataInvalidationTime(long time)
Sets when this table's metadata was last invalidated. |
protected void |
setName(java.lang.String pName)
Sets the name of this Table. |
java.lang.String |
toString()
Returns the String representation of this Table. |
TableCollection |
toTableCollection()
Returns a new TableCollection object containing this table |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String KEY_SEPARATOR
public static final java.lang.String className
Constructor Detail |
protected Table()
createTable()
method instead.
protected Table(java.lang.String pName, Library library)
createTable()
method instead.
library
- LibraryMethod Detail |
public java.lang.StringBuffer appendFullyQualifiedName(java.lang.StringBuffer sb)
public static java.lang.StringBuffer appendFullyQualifiedName(Table t, java.lang.StringBuffer sb)
public int copyFieldDescriptors(java.lang.String newAlias) throws CMException
CMException
public void createFieldDescriptors() throws CMException
CMException
public static Table createTable(java.lang.String systemAlias, java.lang.String libName, java.lang.String tblName)
public static Table createTable(java.lang.String pSystemAlias, java.lang.String pLibraryName, java.lang.String pTableName, java.lang.Class pTableClass)
pSystemAlias
- pLibraryName
- pTableName
- pTableClass
-
public boolean createTableInDB(SQLContext context, boolean overwrite, java.util.List fds) throws CMException
overwrite
- If the table already exists on the specified system, it
is either deleted and recreated or an exception is thrown,
depending on the value of this argument
CMException
public java.util.List getAllOrderedColumnNames() throws CMException
CMException
public java.util.List getAllOrderedColumnNames(boolean pDatabaseOnly) throws CMException
pDatabaseOnly
- When this is false, the returned list may contain
the names of logical columns not present in the database. When
this is true, only the names of columns in the database will
be returned
CMException
public RowCollection getAllRows() throws CMException
CMException
public java.util.List getAutoIncrementFieldDescriptorsA()
public java.lang.String getCreationSQL() throws CMException
CMException
public java.lang.String getCreationSQL(java.lang.String newSystem, java.lang.String newLibrary, java.lang.String newTable) throws CMException
newSystem
- The system on which the new table should be creatednewLibrary
- The library the new table should be created in. This
may be null if the target database system does not require a
librarynewTable
- The name of the new table
CMException
public java.lang.String getCreationSQL(Table table) throws CMException
table
- The table specifing the system, library name, and table name
for the new table
CMException
public java.lang.String getCreationSQL(Table table, java.util.List fieldDescriptors) throws CMException
table
- The table specifing the system, library name, and table name
for the new tablefieldDescriptors
- The field descriptors describing the fields that
should be included in the SQL statement. If this is null, all
of the fields that are in the database table described by the
Table parameter will be included in the SQL statement.
Otherwise, only those fields in this List of field descriptors
(which may or may not be in the database table) will be
included in the SQL.
CMException
public java.lang.String getDBLibraryName()
public java.util.List getFieldDescriptor(java.lang.Class pFldClass) throws CMException
CMException
public FieldDescriptorRow getFieldDescriptor(java.lang.String fldName) throws CMException
fldName
- String
CMException
public FieldDescriptorCollection getFieldDescriptorCollection()
public FieldDescriptorCollection getFieldDescriptorCollection(boolean pCreate) throws CMException
CMException
public java.util.List getFieldDescriptorsWithUsageIdOverlap(Table t)
public java.util.List getFieldNames()
public java.lang.String getFullyQualifiedName()
public byte[] getIPAddress()
getIPAddress
in interface ITable
public java.util.List getKeyFieldNames() throws CMException
CMException
public long getLastUpdated()
public Library getLibrary()
public java.lang.String getLibraryName()
getLibraryName
in interface ITable
public java.util.List getLogicalFieldNames()
public long getMetadataInvalidationTime()
public java.lang.String getMetaDataSystemAlias()
public java.lang.String getName()
ITable
getName
in interface IDBObject
public java.util.List getPhysicalFieldNames()
public PhysicalTable getPhysicalTable()
public Row getRow(RowKey rowKey) throws CMException
CMException
public java.lang.Class getRowClass()
public DBSystem getSystem()
public java.lang.String getSystemAlias()
public java.lang.String getSystemURL()
public static Table getTable(java.lang.String pSystemAlias, java.lang.String pLibraryName, java.lang.String pTableName)
pSystemAlias
- StringpLibraryName
- StringpTableName
- String
public static Table getTable(java.lang.String pSystemAlias, java.lang.String pLibraryName, java.lang.String pTableName, boolean create)
create
- boolean
public TableDescriptor getTableDescriptor() throws CMException
CMException
public java.lang.StringBuffer getXMLData(java.lang.StringBuffer pXMLData)
getXMLData
in interface IXMLObject
public boolean isAuthorized(int mode, ExecutingContext ec)
mode
- A mode constant describing the type of access (such as
Row.MODE_READ, Row.MODE.DELETE, etc.)ec
- The current ExecutingContextpublic boolean isCheckedDataFileForFDs()
public boolean isExistenceConfirmed()
public boolean isFDsReadFromDBMetadata()
public boolean isShared()
public void setCheckedDataFileForFDs(boolean pCheckedDataFileForFDs)
pCheckedDataFileForFDs
- booleanpublic void setFDsReadFromDBMetadata(boolean pAllFDsRead)
public void setLastUpdated(long newLastUpdated)
protected void setLibrary(Library library)
public void setMetadataInvalidationTime(long time)
protected void setName(java.lang.String pName)
public java.lang.String toString()
public TableCollection toTableCollection()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |