Package com.im.commons.db.ddl.tablesets
Class TableSetInfo
- java.lang.Object
-
- com.im.commons.db.ddl.tablesets.TableSetInfo
-
- All Implemented Interfaces:
AbstractInfo
,java.io.Serializable
- Direct Known Subclasses:
AbstractJChemTableSetInfo
,JChemPropertyTableSetInfo
,StandardTableSetInfo
public abstract class TableSetInfo extends java.lang.Object implements AbstractInfo, java.io.Serializable
Describes a set of tables. Often there is just a single table, but when a number of tables form a functional unit they are collected into a single TableSetInfo. An example is a JChem Base table that has an associated _UL table.- Author:
- Martin Adamek
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DBTableInfo[]
tableInfos
-
Constructor Summary
Constructors Modifier Constructor Description protected
TableSetInfo()
protected
TableSetInfo(DBTableInfo... tableInfos)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addToModel(java.lang.String parentID, DBItemsCache cache)
protected void
buildToString(java.lang.StringBuilder builder)
abstract TableSetInfo
clone()
abstract SQLJoin[]
getJoins()
The joins for each of the tables used by this set of tables.DBTableInfo[]
getTableInfos()
Get all the DFTableInfos that are part of this table cluster.SchemaQualifiedName[]
getTableNames()
The names of the "tables" used by this cluster.abstract java.lang.String
getType()
A string that identifies the table type.void
removeFromModel(java.lang.String parentID, DBItemsCache cache)
java.lang.String
schemaPlusTable()
java.lang.String
toString()
void
updateLazyTableInfos()
Load full info if DBTableInfo is lazy.TableSetInfo
updateTableInfos(DBTableInfo... tInfos)
TableSetInfo
updateTableInfosRemoveProxies()
-
-
-
Field Detail
-
tableInfos
protected DBTableInfo[] tableInfos
-
-
Constructor Detail
-
TableSetInfo
protected TableSetInfo()
-
TableSetInfo
protected TableSetInfo(DBTableInfo... tableInfos)
-
-
Method Detail
-
schemaPlusTable
public java.lang.String schemaPlusTable()
-
getType
public abstract java.lang.String getType()
A string that identifies the table type. The value will be one of the TABLE_TYPE_* constants- Returns:
- The table type
-
getTableNames
public SchemaQualifiedName[] getTableNames()
The names of the "tables" used by this cluster. Usually just a single table. See @{link #getTableInfos} for more details.- Returns:
- The table names
-
getTableInfos
public final DBTableInfo[] getTableInfos()
Get all the DFTableInfos that are part of this table cluster. In simple cases this will just be the main table (the tableName property), but other more complex TableSetInfos can use multiple tables. The main table will always be the first table. The term "table" is used in the generic sense and can include views etc. See @{link com.im.commons.db.ddl.DBTableInfo} for more details.- Returns:
- The table infos
-
updateTableInfos
public TableSetInfo updateTableInfos(DBTableInfo... tInfos)
-
updateLazyTableInfos
public void updateLazyTableInfos()
Load full info if DBTableInfo is lazy.
-
updateTableInfosRemoveProxies
public TableSetInfo updateTableInfosRemoveProxies()
-
getJoins
public abstract SQLJoin[] getJoins()
The joins for each of the tables used by this set of tables. The joins information must be supplied in the same order as the tables ingetTableNames()
e.g. the second element in the list of joins corresponds to the join between the master table and the second element in the getTableNames() list. Join information allows data (e.g. a field) to be present in a separate table and provides the information necessary to retreive that information By definition the join for the first element must be a SQLJoin with has a zero length path (e.g. new SQLJoin(new SQLJoin.Path[0]) ), but joins for the other tables can optionally be defined. A join will be defined where the row(s) in the secondary table can be related to those in the master table by means of a join. Not all tables will have such a join, and in these cases the list should contain null for that element in the list.- Returns:
- SQLJoin array
-
clone
public abstract TableSetInfo clone()
- Overrides:
clone
in classjava.lang.Object
-
addToModel
public void addToModel(java.lang.String parentID, DBItemsCache cache)
- Specified by:
addToModel
in interfaceAbstractInfo
-
removeFromModel
public void removeFromModel(java.lang.String parentID, DBItemsCache cache)
- Specified by:
removeFromModel
in interfaceAbstractInfo
-
buildToString
protected void buildToString(java.lang.StringBuilder builder)
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-