|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.im.commons.db.ddl.DBItemsCache
public final class DBItemsCache
A holder and cache for DB-related items such as TableSetInfo. Provides convenience methods for managing these items. Changing the contents of this cache does NOT cause a change to the database. Modifying the contents of this cache must reflect changes that have already been name to the underlying database.
| Constructor Summary | |
|---|---|
DBItemsCache(String defaultSchema)
|
|
| Method Summary | |
|---|---|
TableSetInfo |
addTableSetInfo(TableSetInfo item)
Add a new item to the cache. |
DBItemsCache |
clone()
|
boolean |
containsTableSetInfo(String schemaPlusTable)
|
boolean |
containsTableSetInfo(String dbSchemaName,
String table)
|
void |
dump(StringBuilder b)
Generate a human readable description of current contents and append it to the StringBuilder. |
TableSetInfo |
findTableSetInfoForTable(String schemaPlusTable)
|
TableSetInfo |
findTableSetInfoForTable(String dbSchemaName,
String table)
|
String[] |
getAllSchemaPlusTableNames(boolean onlyMasterTable)
|
String[] |
getAllSchemaPlusTableNames(String dbSchemaName,
boolean onlyMasterTable)
Same as the #getAllTableNames(String) method, but returns the schema qualified table names. |
String[] |
getAllSchemaPlusViewNames()
|
String[] |
getAllSchemaPlusViewNames(String dbSchemaName,
boolean onlyMasterTable)
Same as the #getAllTableNames(String) method, but returns the schema qualified view names. |
List<String> |
getAllSchemas()
Get all the schemas that are accessible to the db user. |
String[] |
getAllTableNames(String dbSchemaName,
boolean onlyMasterTable)
Get the names of the actual physical tables known to this cache. |
String[] |
getAllViewNames(String dbSchemaName,
boolean onlyMasterTable)
Get the names of the views known to this cache. |
SchemaQualifiedName[] |
getConstraintNames()
|
String |
getDefaultSchema()
Get the value of defaultSchema. |
Set<String> |
getPropertyTableNames()
Get the schema qualified names of all property tables that we know about. |
Set<String> |
getPropertyTableNamesForSchema(String dbSchemaName)
Get the non-qualified names of all property tables that we know about in the specified schemas. |
DBTableInfo |
getTableInfo(String schemaPlusTable)
|
DBTableInfo |
getTableInfo(String schema,
String table)
|
Set<String> |
getTablesAssociatedWithPropertyTable(String propTableName)
Get the schema qualified table names (e.g. |
TableSetInfo |
getTableSetInfo(SchemaQualifiedName table)
|
TableSetInfo |
getTableSetInfo(String schemaPlusTable)
|
TableSetInfo |
getTableSetInfo(String dbSchemaName,
String table)
|
List<String> |
getUsedSchemas()
Get the schemas that are currently in use. |
TableSetInfo |
removeTableSetInfo(String schemaPlusTable)
|
TableSetInfo |
removeTableSetInfo(String dbSchemaName,
String table)
|
TableSetInfo |
removeTableSetInfo(TableSetInfo item)
Add a new item to the cache. |
void |
setAllSchemas(List<String> schemas)
Set all schemas accessible to the db user. |
void |
setUsedSchemas(List<String> schemas)
Sets used schemas. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DBItemsCache(String defaultSchema)
| Method Detail |
|---|
public List<String> getAllSchemas()
public void setAllSchemas(List<String> schemas)
schemas - The schemaspublic List<String> getUsedSchemas()
public void setUsedSchemas(List<String> schemas)
schemas - The schemaspublic String getDefaultSchema()
public TableSetInfo addTableSetInfo(TableSetInfo item)
item - a new item
public TableSetInfo getTableSetInfo(String schemaPlusTable)
public TableSetInfo getTableSetInfo(SchemaQualifiedName table)
public TableSetInfo getTableSetInfo(String dbSchemaName,
String table)
public boolean containsTableSetInfo(String schemaPlusTable)
public boolean containsTableSetInfo(String dbSchemaName,
String table)
public TableSetInfo removeTableSetInfo(TableSetInfo item)
item - an item to remove
public TableSetInfo removeTableSetInfo(String schemaPlusTable)
public TableSetInfo removeTableSetInfo(String dbSchemaName,
String table)
public String[] getAllTableNames(String dbSchemaName,
boolean onlyMasterTable)
dbSchemaName - The schema. Must not be a valid schema name known to this cache if
the database supports schemas. If the database does not support schemas you must specify
null.onlyMasterTable - Take only first table from table set info on true.
IllegalArgumentException - If argument is null and the DB supports schemas or
if the DB does not support schemas and you specified non-null schema name
public String[] getAllSchemaPlusTableNames(String dbSchemaName,
boolean onlyMasterTable)
onlyMasterTable - Take only first table from table set info on true.dbSchemaName - The schema name
public String[] getAllSchemaPlusTableNames(boolean onlyMasterTable)
onlyMasterTable - Take only first table from table set info on true.
public String[] getAllViewNames(String dbSchemaName,
boolean onlyMasterTable)
dbSchemaName - The schema. Must not be a valid schema name known to this cache if
the database supports schemas. If the database does not support schemas you must specify
null.onlyMasterTable - Take only first table from table set info on true.
IllegalArgumentException - If argument is null and the DB supports schemas or
if the DB does not support schemas and you specified non-null schema name
public String[] getAllSchemaPlusViewNames(String dbSchemaName,
boolean onlyMasterTable)
dbSchemaName - The name of the database schemaonlyMasterTable - Take only first table from table set info on true.
public String[] getAllSchemaPlusViewNames()
public DBTableInfo getTableInfo(String schemaPlusTable)
public DBTableInfo getTableInfo(String schema,
String table)
public TableSetInfo findTableSetInfoForTable(String schemaPlusTable)
public TableSetInfo findTableSetInfoForTable(String dbSchemaName,
String table)
public SchemaQualifiedName[] getConstraintNames()
public Set<String> getPropertyTableNamesForSchema(String dbSchemaName)
dbSchemaName - The schema name
public Set<String> getPropertyTableNames()
public Set<String> getTablesAssociatedWithPropertyTable(String propTableName)
propTableName -
public DBItemsCache clone()
clone in class Objectpublic void dump(StringBuilder b)
|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||