Interface IDatabaseObject
- 
- All Known Implementing Classes:
 AlterSequenceStartWith,AlterTableAddColumn,AlterTableIdentityCache,BaseObject,CreateIndex,DatabaseObject,FunctionDef,NopObject,ObjectGroup,ProcedureDef,Sequence,Table,Tablespace,View
public interface IDatabaseObjectDefines the Database Object's expected methods. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDependencies(java.util.Collection<IDatabaseObject> deps)Add the collection of dependencies to this objectvoidaddTag(java.lang.String tagName, java.lang.String tagValue)Add the tag name/value to the tag map for this objectvoidapply(java.lang.Integer priorVersion, ISchemaAdapter target, SchemaApplyContext context)Apply migration logic to bring the target database to the current level of this objectvoidapply(ISchemaAdapter target, SchemaApplyContext context)Apply the DDL for this object to the target databasevoidapplyDistributionRules(ISchemaAdapter target, int pass)Apply any distribution rules associated with the object (usually a table)voidapplyTx(ISchemaAdapter target, SchemaApplyContext context, ITransactionProvider cp, 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 databaseITaskGroupcollect(ITaskCollector tc, ISchemaAdapter target, SchemaApplyContext context, ITransactionProvider tp, IVersionHistoryService vhs)Collect the tasks into a dependency tree so that they can be executed concurrently (but in the right order)voiddrop(ISchemaAdapter target)DROP this object from the target databasevoidfetchDependenciesTo(java.util.Collection<IDatabaseObject> out)Fetch dependencies from this into the given out listjava.lang.StringgetName()Return the qualified name for this object (e.g.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 tovoidgrant(ISchemaAdapter target, java.lang.String groupName, java.lang.String toUser)Grant the given privileges to the uservoidvisit(java.util.function.Consumer<IDatabaseObject> c)Visit this object, calling the consumer for itself, or its children if anyvoidvisit(DataModelVisitor v)Visit thisIDatabaseObjectwith the givenDataModelVisitor.voidvisitReverse(DataModelVisitor v)Visit thisIDatabaseObjectwith the givenDataModelVisitor. 
 - 
 
- 
- 
Method Detail
- 
getVersion
int getVersion()
Getter for the schema version number this object applies to- Returns:
 
 
- 
apply
void apply(ISchemaAdapter target, SchemaApplyContext context)
Apply the DDL for this object to the target database- Parameters:
 priorVersion-target- the database targetcontext- context to control the schema apply process
 
- 
apply
void apply(java.lang.Integer priorVersion, ISchemaAdapter target, SchemaApplyContext context)Apply migration logic to bring the target database to the current level of this object- Parameters:
 priorVersion-target- the database targetcontext- to control the schema apply process
 
- 
applyTx
void applyTx(ISchemaAdapter target, SchemaApplyContext context, ITransactionProvider cp, IVersionHistoryService vhs)
Apply the DDL, but within its own transaction- Parameters:
 target- the target database we apply tocontext- the context used to modify how the schema objects are appliedcp- of thread-specific transactionsvhs- the service interface for adding this object to the version history table
 
- 
applyDistributionRules
void applyDistributionRules(ISchemaAdapter target, int pass)
Apply any distribution rules associated with the object (usually a table)- Parameters:
 target- the target database we apply the operation topass- multiple pass number
 
- 
applyVersion
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- Parameters:
 target-context-vhs- the service used to manage the version history table
 
- 
drop
void drop(ISchemaAdapter target)
DROP this object from the target database- Parameters:
 target-
 
- 
grant
void grant(ISchemaAdapter target, java.lang.String groupName, java.lang.String toUser)
Grant the given privileges to the user- Parameters:
 target-groupName-toUser-
 
- 
visit
void visit(java.util.function.Consumer<IDatabaseObject> c)
Visit this object, calling the consumer for itself, or its children if any- Parameters:
 c-
 
- 
visit
void visit(DataModelVisitor v)
Visit thisIDatabaseObjectwith the givenDataModelVisitor. Any sub-objects should be visited in creation order.- Parameters:
 v-
 
- 
visitReverse
void visitReverse(DataModelVisitor v)
Visit thisIDatabaseObjectwith the givenDataModelVisitor. Any sub-objects should be visited in reverse order.- Parameters:
 v-
 
- 
collect
ITaskGroup collect(ITaskCollector tc, ISchemaAdapter target, SchemaApplyContext context, ITransactionProvider tp, IVersionHistoryService vhs)
Collect the tasks into a dependency tree so that they can be executed concurrently (but in the right order)- Parameters:
 tc-target-context-tp-vhs-
 
- 
getName
java.lang.String getName()
Return the qualified name for this object (e.g. schema.name).- Returns:
 
 
- 
getTypeNameVersion
java.lang.String getTypeNameVersion()
Get the qualified name for this object: objectType:objectName:objectVersion- Returns:
 
 
- 
getTags
java.util.Map<java.lang.String,java.lang.String> getTags()
Get the map of tags associated with this object. Used to find things in the PhysicalDataModel- Returns:
 
 
- 
addTag
void addTag(java.lang.String tagName, java.lang.String tagValue)Add the tag name/value to the tag map for this object- Parameters:
 tagName-tagValue-
 
- 
getObjectType
DatabaseObjectType getObjectType()
The type enum of this object- Returns:
 
 
- 
addDependencies
void addDependencies(java.util.Collection<IDatabaseObject> deps)
Add the collection of dependencies to this object- Parameters:
 deps-
 
- 
fetchDependenciesTo
void fetchDependenciesTo(java.util.Collection<IDatabaseObject> out)
Fetch dependencies from this into the given out list- Parameters:
 out-
 
 - 
 
 -