Class DatabaseObject
- java.lang.Object
 - 
- com.ibm.fhir.database.utils.model.DatabaseObject
 
 
- 
- All Implemented Interfaces:
 IDatabaseObject
- Direct Known Subclasses:
 Tablespace
public abstract class DatabaseObject extends Object implements IDatabaseObject
Represents objects which are part of the database, but which do not belong to a particular schema (like tablespace, for example). 
- 
- 
Constructor Summary
Constructors Constructor Description DatabaseObject(String objectName, DatabaseObjectType objectType, int version)Public constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTag(String tagGroup, String tagValue)Add the tagGroup/tagValue pair to the tags for this objectvoidaddTags(Map<String,String> tags)Add the given tags to our tag mapvoidapplyTx(IDatabaseAdapter target, ITransactionProvider tp, IVersionHistoryService vhs)Apply the DDL, but within its own transactionvoidapplyVersion(IDatabaseAdapter target, IVersionHistoryService vhs)Apply the change, but only if it has a newer version than we already have recorded in the databasebooleanequals(Object other)Collection<IDatabaseObject>getDependencies()Get the collection of dependencies for this objectStringgetName()Return the unique name for this objectStringgetObjectName()DatabaseObjectTypegetObjectType()The type enum of this objectMap<String,String>getTags()Get the map of tags associated with this object.StringgetTypeNameVersion()Get the qualified name for this object: objectType:objectName:objectVersionintgetVersion()Getter for the schema version number this object applies tointhashCode()protected voidsafeSleep()Sleep a random amount of time.StringtoString()voidvisit(Consumer<IDatabaseObject> c)Visit this object, calling the consumer for itself, or its children if any- 
Methods inherited from interface com.ibm.fhir.database.utils.model.IDatabaseObject
addDependencies, apply, apply, collect, drop, fetchDependenciesTo, grant, visit, visitReverse 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
DatabaseObject
public DatabaseObject(String objectName, DatabaseObjectType objectType, int version)
Public constructor- Parameters:
 objectName-objectType-version-
 
 - 
 
- 
Method Detail
- 
getDependencies
public Collection<IDatabaseObject> getDependencies()
Get the collection of dependencies for this object- Returns:
 
 
- 
getVersion
public int getVersion()
Description copied from interface:IDatabaseObjectGetter for the schema version number this object applies to- Specified by:
 getVersionin interfaceIDatabaseObject- Returns:
 
 
- 
getObjectType
public DatabaseObjectType getObjectType()
Description copied from interface:IDatabaseObjectThe type enum of this object- Specified by:
 getObjectTypein interfaceIDatabaseObject- Returns:
 
 
- 
getObjectName
public String getObjectName()
 
- 
getTypeNameVersion
public String getTypeNameVersion()
Description copied from interface:IDatabaseObjectGet the qualified name for this object: objectType:objectName:objectVersion- Specified by:
 getTypeNameVersionin interfaceIDatabaseObject- Returns:
 
 
- 
addTags
public void addTags(Map<String,String> tags)
Add the given tags to our tag map- Parameters:
 tags-
 
- 
addTag
public void addTag(String tagGroup, String tagValue)
Add the tagGroup/tagValue pair to the tags for this object- Specified by:
 addTagin interfaceIDatabaseObject- Parameters:
 tagGroup-tagValue-
 
- 
getName
public String getName()
Return the unique name for this object- Specified by:
 getNamein interfaceIDatabaseObject- Returns:
 
 
- 
applyTx
public void applyTx(IDatabaseAdapter target, ITransactionProvider tp, IVersionHistoryService vhs)
Description copied from interface:IDatabaseObjectApply the DDL, but within its own transaction- Specified by:
 applyTxin interfaceIDatabaseObject- Parameters:
 target- the target database we apply totp- of thread-specific transactionsvhs- the service interface for adding this object to the version history table
 
- 
applyVersion
public void applyVersion(IDatabaseAdapter target, IVersionHistoryService vhs)
Apply the change, but only if it has a newer version than we already have recorded in the database- Specified by:
 applyVersionin interfaceIDatabaseObject- Parameters:
 target-vhs- the service used to manage the version history table
 
- 
safeSleep
protected void safeSleep()
Sleep a random amount of time. 
- 
getTags
public Map<String,String> getTags()
Description copied from interface:IDatabaseObjectGet the map of tags associated with this object. Used to find things in the PhysicalDataModel- Specified by:
 getTagsin interfaceIDatabaseObject- Returns:
 
 
- 
visit
public void visit(Consumer<IDatabaseObject> c)
Description copied from interface:IDatabaseObjectVisit this object, calling the consumer for itself, or its children if any- Specified by:
 visitin interfaceIDatabaseObject
 
 - 
 
 -