Class DatabaseObject
- java.lang.Object
 - 
- org.linuxforhealth.fhir.database.utils.model.DatabaseObject
 
 
- 
- All Implemented Interfaces:
 IDatabaseObject
- Direct Known Subclasses:
 Tablespace
public abstract class DatabaseObject extends java.lang.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(java.lang.String objectName, DatabaseObjectType objectType, int version)Public constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTag(java.lang.String tagGroup, java.lang.String tagValue)Add the tagGroup/tagValue pair to the tags for this objectvoidaddTags(java.util.Map<java.lang.String,java.lang.String> tags)Add the given tags to our tag mapvoidapplyDistributionRules(ISchemaAdapter target, int pass)Apply any distribution rules associated with the object (usually a table)voidapplyTx(ISchemaAdapter target, SchemaApplyContext context, ITransactionProvider tp, IVersionHistoryService vhs)Apply the DDL, but within its own transactionvoidapplyVersion(ISchemaAdapter target, SchemaApplyContext context, IVersionHistoryService vhs)Apply the change, but only if it has a newer version than we already have recorded in the databasebooleanequals(java.lang.Object other)java.util.Collection<IDatabaseObject>getDependencies()Get the collection of dependencies for this objectjava.lang.StringgetName()Return the unique name for this objectjava.lang.StringgetObjectName()DatabaseObjectTypegetObjectType()The type enum of this objectjava.util.Map<java.lang.String,java.lang.String>getTags()Get the map of tags associated with this object.java.lang.StringgetTypeNameVersion()Get the qualified name for this object: objectType:objectName:objectVersionintgetVersion()Getter for the schema version number this object applies tointhashCode()java.lang.StringtoString()voidvisit(java.util.function.Consumer<IDatabaseObject> c)Visit this object, calling the consumer for itself, or its children if any- 
Methods inherited from interface org.linuxforhealth.fhir.database.utils.model.IDatabaseObject
addDependencies, apply, apply, collect, drop, fetchDependenciesTo, grant, visit, visitReverse 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
DatabaseObject
public DatabaseObject(java.lang.String objectName, DatabaseObjectType objectType, int version)Public constructor- Parameters:
 objectName-objectType-version-
 
 - 
 
- 
Method Detail
- 
getDependencies
public java.util.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:
 
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
getObjectName
public java.lang.String getObjectName()
 
- 
getTypeNameVersion
public java.lang.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(java.util.Map<java.lang.String,java.lang.String> tags)
Add the given tags to our tag map- Parameters:
 tags-
 
- 
addTag
public void addTag(java.lang.String tagGroup, java.lang.String tagValue)Add the tagGroup/tagValue pair to the tags for this object- Specified by:
 addTagin interfaceIDatabaseObject- Parameters:
 tagGroup-tagValue-
 
- 
equals
public boolean equals(java.lang.Object other)
- Overrides:
 equalsin classjava.lang.Object
 
- 
getName
public java.lang.String getName()
Return the unique name for this object- Specified by:
 getNamein interfaceIDatabaseObject- Returns:
 
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
applyTx
public void applyTx(ISchemaAdapter target, SchemaApplyContext context, 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 tocontext- the context used to modify how the schema objects are appliedtp- of thread-specific transactionsvhs- the service interface for adding this object to the version history table
 
- 
applyVersion
public void applyVersion(ISchemaAdapter target, SchemaApplyContext context, 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
 
- 
getTags
public java.util.Map<java.lang.String,java.lang.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(java.util.function.Consumer<IDatabaseObject> c)
Description copied from interface:IDatabaseObjectVisit this object, calling the consumer for itself, or its children if any- Specified by:
 visitin interfaceIDatabaseObject
 
- 
applyDistributionRules
public void applyDistributionRules(ISchemaAdapter target, int pass)
Description copied from interface:IDatabaseObjectApply any distribution rules associated with the object (usually a table)- Specified by:
 applyDistributionRulesin interfaceIDatabaseObject- Parameters:
 target- the target database we apply the operation topass- multiple pass number
 
 - 
 
 -