Interface IDatabaseObject
-
- All Known Implementing Classes:
AlterSequenceStartWith
,AlterTableIdentityCache
,BaseObject
,CreateIndex
,DatabaseObject
,FunctionDef
,NopObject
,ObjectGroup
,ProcedureDef
,RowArrayType
,RowType
,Sequence
,SessionVariableDef
,Table
,Tablespace
public interface IDatabaseObject
Defines the Database Object's expected methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDependencies(Collection<IDatabaseObject> deps)
Add the collection of dependencies to this objectvoid
addTag(String tagName, String tagValue)
Add the tag name/value to the tag map for this objectvoid
apply(IDatabaseAdapter target)
Apply the DDL for this object to the target databasevoid
apply(Integer priorVersion, IDatabaseAdapter target)
Apply migration logic to bring the target database to the current level of this objectvoid
applyTx(IDatabaseAdapter target, ITransactionProvider cp, IVersionHistoryService vhs)
Apply the DDL, but within its own transactionvoid
applyVersion(IDatabaseAdapter target, IVersionHistoryService vhs)
Apply the change, but only if it has a newer version than we already have recorded in the databaseITaskGroup
collect(ITaskCollector tc, IDatabaseAdapter target, ITransactionProvider tp, IVersionHistoryService vhs)
Collect the tasks into a dependency tree so that they can be executed concurrently (but in the right order)void
drop(IDatabaseAdapter target)
DROP this object from the target databasevoid
fetchDependenciesTo(Collection<IDatabaseObject> out)
Fetch dependencies from this into the given out listString
getName()
Return the qualified name for this object (e.g.DatabaseObjectType
getObjectType()
The type enum of this objectMap<String,String>
getTags()
Get the map of tags associated with this object.String
getTypeNameVersion()
Get the qualified name for this object: objectType:objectName:objectVersionint
getVersion()
Getter for the schema version number this object applies tovoid
grant(IDatabaseAdapter target, String groupName, String toUser)
Grant the given privileges to the uservoid
visit(DataModelVisitor v)
Visit thisIDatabaseObject
with the givenDataModelVisitor
.void
visit(Consumer<IDatabaseObject> c)
Visit this object, calling the consumer for itself, or its children if anyvoid
visitReverse(DataModelVisitor v)
Visit thisIDatabaseObject
with the givenDataModelVisitor
.
-
-
-
Method Detail
-
getVersion
int getVersion()
Getter for the schema version number this object applies to- Returns:
-
apply
void apply(IDatabaseAdapter target)
Apply the DDL for this object to the target database- Parameters:
priorVersion
-target
- the database target
-
apply
void apply(Integer priorVersion, IDatabaseAdapter target)
Apply migration logic to bring the target database to the current level of this object- Parameters:
priorVersion
-target
- the database target
-
applyTx
void applyTx(IDatabaseAdapter target, ITransactionProvider cp, IVersionHistoryService vhs)
Apply the DDL, but within its own transaction- Parameters:
target
- the target database we apply tocp
- of thread-specific transactionsvhs
- the service interface for adding this object to the version history table
-
applyVersion
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- Parameters:
target
-vhs
- the service used to manage the version history table
-
drop
void drop(IDatabaseAdapter target)
DROP this object from the target database- Parameters:
target
-
-
grant
void grant(IDatabaseAdapter target, String groupName, String toUser)
Grant the given privileges to the user- Parameters:
target
-groupName
-toUser
-
-
visit
void visit(Consumer<IDatabaseObject> c)
Visit this object, calling the consumer for itself, or its children if any- Parameters:
c
-
-
visit
void visit(DataModelVisitor v)
Visit thisIDatabaseObject
with the givenDataModelVisitor
. Any sub-objects should be visited in creation order.- Parameters:
v
-
-
visitReverse
void visitReverse(DataModelVisitor v)
Visit thisIDatabaseObject
with the givenDataModelVisitor
. Any sub-objects should be visited in reverse order.- Parameters:
v
-
-
collect
ITaskGroup collect(ITaskCollector tc, IDatabaseAdapter target, 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
-tp
-vhs
-
-
getName
String getName()
Return the qualified name for this object (e.g. schema.name).- Returns:
-
getTypeNameVersion
String getTypeNameVersion()
Get the qualified name for this object: objectType:objectName:objectVersion- Returns:
-
getTags
Map<String,String> getTags()
Get the map of tags associated with this object. Used to find things in the PhysicalDataModel- Returns:
-
addTag
void addTag(String tagName, 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(Collection<IDatabaseObject> deps)
Add the collection of dependencies to this object- Parameters:
deps
-
-
fetchDependenciesTo
void fetchDependenciesTo(Collection<IDatabaseObject> out)
Fetch dependencies from this into the given out list- Parameters:
out
-
-
-