Package de.ubs.xdm.utils.databasemodel
Class MultiObjectContainer
java.lang.Object
de.ubs.xdm.utils.databasemodel.AbstractObjectContainer
de.ubs.xdm.utils.databasemodel.MultiObjectContainer
- All Implemented Interfaces:
Serializable
- Author:
- christoph
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlias(de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias alias) voidaddAuxiliaryObject(de.ubs.xdm.utils.databasemodel.model.db.AuxiliaryObject auxilary) voidaddIndex(de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex index) voidaddSequenceObject(de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject so) voidaddTable(de.ubs.xdm.utils.databasemodel.model.db.AbstractTable t) voidaddTablespace(de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace tablespace) intReturns the total number of aliases in this container.intReturns the total number of auxiliary objects in this container.intReturns the total number of databases in this container.intReturns the total number of indexes in this container.intReturns the total number of schemas in this container.intReturns the total number of sequences in this container.intReturns the total number of tables in this container.intReturns the total number of tablespaces in this container.intReturns the total number of views in this container.de.ubs.xdm.utils.databasemodel.model.db.AbstractAliasCollection<de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> Returns a collection ofAbstractAliasobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all aliases in the container.Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> getAllocatedObject(Object obj) Collection<de.ubs.xdm.utils.databasemodel.model.db.AuxiliaryObject> Returns a collection ofAuxiliaryObjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all auxiliary objects in the container.getContainer(int idx) getContainerByIndex(int idx) This method returns the sub-container with the given index.getContainerByName(String name) This method returns the inner container with the given name.intreturns the container list without null entriesReturns a list of all the database names which are referenced by this container.de.ubs.xdm.utils.databasemodel.model.db.AbstractIndexgetIndex(de.ubs.xdm.utils.databasemodel.model.db.IndexUniqueName iun) Use getIndex with TableUniqueName instead.de.ubs.xdm.utils.databasemodel.model.db.AbstractIndexgetIndex(de.ubs.xdm.utils.databasemodel.model.db.TableUniqueName tableUniqueName, String ixowner, String ixname) Collection<de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex> Returns a collection ofAbstractIndexobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all index objects in the container.Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex> getObject(UniqueName name) de.ubs.xdm.utils.databasemodel.sorter.cycles.OrderedTablesreturns the container list with possible null entriesDeprecated.Returns a collection of strings representing the schemas in this container.Collection<de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject> Returns a collection ofAbstractSequenceObjectobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all sequences in the container.de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObjectgetSequenceObject(de.ubs.xdm.utils.databasemodel.model.db.SequenceUniqueName sun) de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObjectgetSequenceObject(String schema, String name) Calculates a list of all tables in the container sorted by their dependency.de.ubs.xdm.utils.databasemodel.model.db.AbstractTablegetTable(de.ubs.xdm.utils.databasemodel.model.db.TableUniqueName tun) de.ubs.xdm.utils.databasemodel.model.db.AbstractTableCollection<de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> Returns a collection ofAbstractTableobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all table objects in the container.Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> Collection<de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespacegetTablespace(de.ubs.xdm.utils.databasemodel.model.db.TablespaceUniqueName tun) Collection<de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> Returns a collection ofAbstractTablespaceobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all tablespaces in the container.Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> getUser()de.ubs.xdm.utils.databasemodel.model.db.AbstractViewgetView(UniqueName tun) de.ubs.xdm.utils.databasemodel.model.db.AbstractViewCollection<de.ubs.xdm.utils.databasemodel.model.db.AbstractView> Returns a collection ofAbstractViewobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all views in the container.booleanindexListOfIdenticalConnectionNames(String containerName) booleanvoidmergeOrAddContainer(ObjectContainer objectContainer, int containerIndex) voidvoidremoveObject(UniqueName name) voidsetAliasMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> aliasMap) voidsetCreationDate(Calendar creationDate) voidsetDatabaseMetaData(DatabaseMetaData databaseMetaData) voidsetFileName(String fileName) voidsetIndexMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex> indexMap) voidsetReadOnly(boolean readOnly) voidsetTableMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> tableMap) voidsetTablespaceMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> tablespaceMap) voidsetUniqueObjectMap(Map<UniqueName, UniqueIdentifiable> uniqueObjectMap) intsize()Methods inherited from class de.ubs.xdm.utils.databasemodel.AbstractObjectContainer
addObjectContainerListener, fireAliasAddedEvent, fireAliasRemovedEvent, fireAuxiliaryObjectAddedEvent, fireAuxiliaryObjectRemovedEvent, fireIndexAddedEvent, fireIndexRemovedEvent, fireSequenceAddedEvent, fireSequenceRemovedEvent, fireTableAddedEvent, fireTableRemovedEvent, fireTablespaceAddedEvent, fireTablespaceRemovedEvent, fireViewAddedEvent, fireViewRemovedEvent, getContainerName, getCurrentCatalogFieldShortener, getParent, readResolve, removeObjectContainerListener, setCurrentCatalogFieldShortener, setParent
-
Constructor Details
-
MultiObjectContainer
public MultiObjectContainer()
-
-
Method Details
-
getContainerByIndex
This method returns the sub-container with the given index. If no container with this index exists, it will return null. An IndexOutOfBoundException will not be thrown.- Parameters:
idx-- Returns:
-
getContainer
-
getContainerIndex
public int getContainerIndex()- Specified by:
getContainerIndexin classAbstractObjectContainer
-
getContainerByName
This method returns the inner container with the given name. Do not use this method from outside of DatabaseModel, because this may lead to use incorrect namings for the containers. As the containers names typically are based on names that tend to change, they should not be used as a reference in outside programs.- Parameters:
name-- Returns:
-
getPlainContainers
returns the container list with possible null entries- Returns:
-
getContainers
returns the container list without null entries- Returns:
-
size
public int size() -
removeObject
- Specified by:
removeObjectin classAbstractObjectContainer
-
indexListOfIdenticalConnectionNames
-
removeObject
- Specified by:
removeObjectin classAbstractObjectContainer
-
getCreationDate
- Specified by:
getCreationDatein classAbstractObjectContainer
-
setCreationDate
- Specified by:
setCreationDatein classAbstractObjectContainer
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin classAbstractObjectContainer
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnlyin classAbstractObjectContainer
-
getObject
- Specified by:
getObjectin classAbstractObjectContainer
-
getFileName
- Specified by:
getFileNamein classAbstractObjectContainer
-
setFileName
- Specified by:
setFileNamein classAbstractObjectContainer
-
getCurrentTime
- Specified by:
getCurrentTimein classAbstractObjectContainer
-
getUser
- Specified by:
getUserin classAbstractObjectContainer
-
getSystemName
- Specified by:
getSystemNamein classAbstractObjectContainer
-
getAllocatedObject
- Specified by:
getAllocatedObjectin classAbstractObjectContainer- Parameters:
obj-- Returns:
-
getTablesForTableSpace
public Collection<de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> getTablesForTableSpace(Tablespace tbs) - Specified by:
getTablesForTableSpacein classAbstractObjectContainer
-
getDatabaseNames
Description copied from class:AbstractObjectContainerReturns a list of all the database names which are referenced by this container. Each database name is only listed once in the collection.- Specified by:
getDatabaseNamesin classAbstractObjectContainer- Returns:
Collection<String>
-
getSchemaList
Deprecated.- Specified by:
getSchemaListin classAbstractObjectContainer
-
getSchemaNames
Description copied from class:AbstractObjectContainerReturns a collection of strings representing the schemas in this container. Each schema name is listed at most once in the collection.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all schemas in the container. For instance, if the container references different databases and a schema with the same name occurs in more than one of these, then the name will never-the-less appear only once.- Specified by:
getSchemaNamesin classAbstractObjectContainer- Returns:
Collection<String>
-
getDatabaseMetaData
- Specified by:
getDatabaseMetaDatain classAbstractObjectContainer
-
setDatabaseMetaData
- Specified by:
setDatabaseMetaDatain classAbstractObjectContainer
-
getTablespace
public de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace getTablespace(de.ubs.xdm.utils.databasemodel.model.db.TablespaceUniqueName tun) - Specified by:
getTablespacein classAbstractObjectContainer
-
getTablespaceMap
public Map<UniqueName,de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> getTablespaceMap()- Specified by:
getTablespaceMapin classAbstractObjectContainer
-
setTablespaceMap
public void setTablespaceMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> tablespaceMap) - Specified by:
setTablespaceMapin classAbstractObjectContainer
-
getIndex
public de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex getIndex(de.ubs.xdm.utils.databasemodel.model.db.TableUniqueName tableUniqueName, String ixowner, String ixname) - Specified by:
getIndexin classAbstractObjectContainer
-
getIndex
public de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex getIndex(de.ubs.xdm.utils.databasemodel.model.db.IndexUniqueName iun) Description copied from class:AbstractObjectContainerUse getIndex with TableUniqueName instead. This allows to fix object container some special configuration like aliased tables.- Specified by:
getIndexin classAbstractObjectContainer- Parameters:
iun-- Returns:
-
getSequenceObject
public de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject getSequenceObject(String schema, String name) - Specified by:
getSequenceObjectin classAbstractObjectContainer
-
getSequenceObject
public de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject getSequenceObject(de.ubs.xdm.utils.databasemodel.model.db.SequenceUniqueName sun) - Specified by:
getSequenceObjectin classAbstractObjectContainer
-
getTable
- Specified by:
getTablein classAbstractObjectContainer
-
getView
- Specified by:
getViewin classAbstractObjectContainer
-
getAlias
- Specified by:
getAliasin classAbstractObjectContainer
-
getTable
public de.ubs.xdm.utils.databasemodel.model.db.AbstractTable getTable(de.ubs.xdm.utils.databasemodel.model.db.TableUniqueName tun) - Specified by:
getTablein classAbstractObjectContainer
-
getView
- Specified by:
getViewin classAbstractObjectContainer
-
getTableMap
- Specified by:
getTableMapin classAbstractObjectContainer
-
setTableMap
public void setTableMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> tableMap) - Specified by:
setTableMapin classAbstractObjectContainer
-
getAliasList
Description copied from class:AbstractObjectContainerReturns a collection ofAbstractAliasobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all aliases in the container. Therefore Use thecountAliases()method instead ofCollection.size().- Specified by:
getAliasListin classAbstractObjectContainer- Returns:
Collection<AbstractAlias>
-
getAliasMap
- Specified by:
getAliasMapin classAbstractObjectContainer
-
setAliasMap
public void setAliasMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> aliasMap) - Specified by:
setAliasMapin classAbstractObjectContainer
-
getIndexMap
- Specified by:
getIndexMapin classAbstractObjectContainer
-
setIndexMap
public void setIndexMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex> indexMap) - Specified by:
setIndexMapin classAbstractObjectContainer
-
addTablespace
public void addTablespace(de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace tablespace) - Specified by:
addTablespacein classAbstractObjectContainer
-
addAuxiliaryObject
public void addAuxiliaryObject(de.ubs.xdm.utils.databasemodel.model.db.AuxiliaryObject auxilary) - Specified by:
addAuxiliaryObjectin classAbstractObjectContainer
-
addIndex
public void addIndex(de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex index) - Specified by:
addIndexin classAbstractObjectContainer
-
addSequenceObject
public void addSequenceObject(de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject so) - Specified by:
addSequenceObjectin classAbstractObjectContainer
-
addAlias
public void addAlias(de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias alias) - Specified by:
addAliasin classAbstractObjectContainer
-
addTable
public void addTable(de.ubs.xdm.utils.databasemodel.model.db.AbstractTable t) - Specified by:
addTablein classAbstractObjectContainer
-
getTablespaceList
Description copied from class:AbstractObjectContainerReturns a collection ofAbstractTablespaceobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all tablespaces in the container. Therefore Use thecountTablespaces()method instead ofCollection.size().- Specified by:
getTablespaceListin classAbstractObjectContainer- Returns:
Collection<AbstractTablespace>
-
getIndexList
Description copied from class:AbstractObjectContainerReturns a collection ofAbstractIndexobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all index objects in the container. Therefore Use thecountIndexes()method instead ofCollection.size().- Specified by:
getIndexListin classAbstractObjectContainer- Returns:
Collection<AbstractTablespace>
-
getTableList
Description copied from class:AbstractObjectContainerReturns a collection ofAbstractTableobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all table objects in the container. Therefore Use thecountTables()method instead ofCollection.size().- Specified by:
getTableListin classAbstractObjectContainer- Returns:
Collection<AbstractTable>
-
getViewList
Description copied from class:AbstractObjectContainerReturns a collection ofAbstractViewobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all views in the container. Therefore Use thecountViews()method instead ofCollection.size().- Specified by:
getViewListin classAbstractObjectContainer- Returns:
Collection<AbstractView>
-
getSequenceList
Description copied from class:AbstractObjectContainerReturns a collection ofAbstractSequenceObjectobjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all sequences in the container. Therefore Use thecountSequences()method instead ofCollection.size().- Specified by:
getSequenceListin classAbstractObjectContainer- Returns:
Collection<AbstractSequence>
-
getAuxiliaryList
Description copied from class:AbstractObjectContainerReturns a collection ofAuxiliaryObjects.
Note: if this is an instance ofMultiObjectContainer, the collection is not guaranteed to include all auxiliary objects in the container. Therefore Use thecountAuxiliaryObjects()method instead ofCollection.size().- Specified by:
getAuxiliaryListin classAbstractObjectContainer- Returns:
Collection<AuxiliaryObject>
-
getUniqueObjectMap
- Specified by:
getUniqueObjectMapin classAbstractObjectContainer
-
setUniqueObjectMap
- Specified by:
setUniqueObjectMapin classAbstractObjectContainer
-
getObjectMap
- Specified by:
getObjectMapin classAbstractObjectContainer- Returns:
- a map were all objects a accessible through their unique name
-
countAliases
public int countAliases()Description copied from class:AbstractObjectContainerReturns the total number of aliases in this container.- Specified by:
countAliasesin classAbstractObjectContainer- Returns:
- int
-
countAuxiliaryObjects
public int countAuxiliaryObjects()Description copied from class:AbstractObjectContainerReturns the total number of auxiliary objects in this container.- Specified by:
countAuxiliaryObjectsin classAbstractObjectContainer- Returns:
- int
-
countIndexes
public int countIndexes()Description copied from class:AbstractObjectContainerReturns the total number of indexes in this container.- Specified by:
countIndexesin classAbstractObjectContainer- Returns:
- int
-
countSchemas
public int countSchemas()Description copied from class:AbstractObjectContainerReturns the total number of schemas in this container.- Specified by:
countSchemasin classAbstractObjectContainer- Returns:
- int
-
countDatabases
public int countDatabases()Description copied from class:AbstractObjectContainerReturns the total number of databases in this container.- Specified by:
countDatabasesin classAbstractObjectContainer- Returns:
- int
-
countSequences
public int countSequences()Description copied from class:AbstractObjectContainerReturns the total number of sequences in this container.- Specified by:
countSequencesin classAbstractObjectContainer- Returns:
- int
-
countTables
public int countTables()Description copied from class:AbstractObjectContainerReturns the total number of tables in this container.- Specified by:
countTablesin classAbstractObjectContainer- Returns:
- int
-
countTablespaces
public int countTablespaces()Description copied from class:AbstractObjectContainerReturns the total number of tablespaces in this container.- Specified by:
countTablespacesin classAbstractObjectContainer- Returns:
- int
-
countViews
public int countViews()Description copied from class:AbstractObjectContainerReturns the total number of views in this container.- Specified by:
countViewsin classAbstractObjectContainer- Returns:
- int
-
getSortedTableList
Description copied from class:AbstractObjectContainerCalculates a list of all tables in the container sorted by their dependency. A table at position n depends only on tables on positions- Specified by:
getSortedTableListin classAbstractObjectContainer- Returns:
-
getOrderedTables
public de.ubs.xdm.utils.databasemodel.sorter.cycles.OrderedTables getOrderedTables()- Specified by:
getOrderedTablesin classAbstractObjectContainer
-
mergeOrAddContainer
-
hasMultipleContainersNamedEqual
public boolean hasMultipleContainersNamedEqual()
-