Package de.ubs.xdm.utils.databasemodel
Class ObjectContainer
java.lang.Object
de.ubs.xdm.utils.databasemodel.AbstractObjectContainer
de.ubs.xdm.utils.databasemodel.ObjectContainer
- All Implemented Interfaces:
Serializable
- Author:
- Sven Schneider
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedObjectContainer(DatabaseMetaData dmd, String containerName) ObjectContainer(String containerName) ObjectContainer(String containerName, ObjectContainer propertyObjectKeyIndexesContainer) Constructor to transport the property index map from the one container to the new container. -
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) voidaddView(de.ubs.xdm.utils.databasemodel.model.db.AbstractView v) 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> Collection<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.intReturns the index of this container in the parent MultiObjectContainer.Returns 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> getKeysFor(Class<? extends PropertyObject> aClass) getObject(UniqueName name) Deprecated.very expensive operation.de.ubs.xdm.utils.databasemodel.sorter.cycles.OrderedTablesMap<de.ubs.xdm.utils.databasemodel.model.db.TableUniqueName, de.ubs.xdm.utils.databasemodel.model.db.ReplacementTable> Deprecated.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()intde.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.intindexOfUniqueKey(Class<? extends PropertyObject> aClass, String key, boolean mayAddNewIndizies) This method returns the index in the PropertyObjects arrays for the given classbooleanvoidmergePropertyObjectKeysFrom(ObjectContainer otherObjectContainer) Adds missing keys from the other object container to this container This is helpful if objects are transferred between containers and the new container does not containa all the keys the source container knows of.voidvoidremoveObject(UniqueName name) voidsetAliasList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> aliases) Method stub for serialization/deserialization.voidsetAliasMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> aliasMap) voidsetAuxiliaryList(List<de.ubs.xdm.utils.databasemodel.model.db.AuxiliaryObject> objects) Method stub for serialization/deserialization.voidsetCreationDate(Calendar creationDate) voidsetDatabaseMetaData(DatabaseMetaData databaseMetaData) voidsetFileName(String fileName) voidsetIndexList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex> indexes) Method stub for serialization/deserialization.voidsetIndexMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractIndex> indexMap) voidsetReadOnly(boolean readOnly) voidsetSequenceList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject> sequences) Method stub for serialization/deserialization.voidsetTableList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> tables) Method stub for serialization/deserialization.voidsetTableMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> tableMap) voidsetTablespaceList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> tablespaces) Method stub for serialization/deserialization.voidsetTablespaceMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> tablespaceMap) voidsetUniqueObjectMap(Map<UniqueName, UniqueIdentifiable> uniqueObjectMap) voidsetVersion(int version) voidsetViewList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractView> views) Method stub for serialization/deserialization.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
-
ObjectContainer
-
ObjectContainer
-
ObjectContainer
Constructor to transport the property index map from the one container to the new container. If objects should be moved into the new container from the existing on, the containers need to have the same property index map.- Parameters:
containerName-propertyObjectKeyIndexesContainer-
-
ObjectContainer
protected ObjectContainer()
-
-
Method Details
-
getContainerIndex
public int getContainerIndex()Returns the index of this container in the parent MultiObjectContainer. If this container is not part of an parent container it will return -1.- Specified by:
getContainerIndexin classAbstractObjectContainer- Returns:
- the index if any, else -1
-
getAliases
public Collection<de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> getAliases(StandaloneObject so) -
removeObject
- Specified by:
removeObjectin classAbstractObjectContainer
-
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
-
getView
- Specified by:
getViewin classAbstractObjectContainer
-
getView
- Specified by:
getViewin 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
-
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
-
getTableMap
- Specified by:
getTableMapin classAbstractObjectContainer
-
setTableMap
public void setTableMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractTable> tableMap) - Specified by:
setTableMapin 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
-
addTable
public void addTable(de.ubs.xdm.utils.databasemodel.model.db.AbstractTable t) - Specified by:
addTablein classAbstractObjectContainer
-
addView
public void addView(de.ubs.xdm.utils.databasemodel.model.db.AbstractView v) -
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>
-
setTablespaceList
public void setTablespaceList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractTablespace> tablespaces) Method stub for serialization/deserialization. Should not be called from code- Parameters:
tablespaces-
-
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>
-
setIndexList
Method stub for serialization/deserialization. Should not be called from code- Parameters:
indexes-
-
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>
-
setTableList
Method stub for serialization/deserialization. Should not be called from code- Parameters:
tables-
-
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>
-
setSequenceList
public void setSequenceList(List<de.ubs.xdm.utils.databasemodel.model.db.AbstractSequenceObject> sequences) Method stub for serialization/deserialization. Should not be called from code- Parameters:
sequences-
-
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>
-
setViewList
Method stub for serialization/deserialization. Should not be called from code- Parameters:
views-
-
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>
-
setAuxiliaryList
Method stub for serialization/deserialization. Should not be called from code- Parameters:
objects-
-
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
-
getUniqueObjectMap
- Specified by:
getUniqueObjectMapin classAbstractObjectContainer
-
setUniqueObjectMap
- Specified by:
setUniqueObjectMapin classAbstractObjectContainer
-
getObjectMap
Deprecated.very expensive operation. Prefer getObject(UniqueName)- Specified by:
getObjectMapin classAbstractObjectContainer- Returns:
- a map were all objects a accessible through their unique name
-
getSortedTableList
Calculates 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
-
getAliasMap
- Specified by:
getAliasMapin classAbstractObjectContainer
-
setAliasMap
public void setAliasMap(Map<UniqueName, de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias> aliasMap) - Specified by:
setAliasMapin classAbstractObjectContainer
-
addAlias
public void addAlias(de.ubs.xdm.utils.databasemodel.model.db.AbstractAlias alias) - Specified by:
addAliasin 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>
-
setAliasList
Method stub for serialization/deserialization. Should not be called from code- Parameters:
aliases-
-
indexOfUniqueKey
public int indexOfUniqueKey(Class<? extends PropertyObject> aClass, String key, boolean mayAddNewIndizies) This method returns the index in the PropertyObjects arrays for the given class- Parameters:
aClass- The class that has the array and needs a matching indexkey- The key we are looking for an index in the arraymayAddNewIndizies- if a new index may be generated for a key name that is not available- Returns:
-
getKeysFor
-
mergePropertyObjectKeysFrom
Adds missing keys from the other object container to this container This is helpful if objects are transferred between containers and the new container does not containa all the keys the source container knows of.- Parameters:
otherObjectContainer-
-
getVersion
public int getVersion() -
setVersion
public void setVersion(int version) -
getReplacementTableMap
public Map<de.ubs.xdm.utils.databasemodel.model.db.TableUniqueName,de.ubs.xdm.utils.databasemodel.model.db.ReplacementTable> getReplacementTableMap()
-