Class CreateIndex
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.model.BaseObject
-
- org.linuxforhealth.fhir.database.utils.model.CreateIndex
-
- All Implemented Interfaces:
IDatabaseObject
public class CreateIndex extends BaseObject
Index creation definition for creating new indexes after the table has been defined (e.g. in a subsequent version)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CreateIndex.Builder
Builder to implement fluent construction ofCreateIndex
objects.
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.database.utils.model.BaseObject
migrations, version
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CreateIndex(java.lang.String schemaName, java.lang.String versionTrackingName, java.lang.String tableName, int version, IndexDef indexDef, java.lang.String tenantColumnName, DistributionType distributionType, java.lang.String distributionColumnName)
Protected constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(java.lang.Integer priorVersion, ISchemaAdapter target, SchemaApplyContext context)
Apply migration logic to bring the target database to the current level of this objectvoid
apply(ISchemaAdapter target, SchemaApplyContext context)
Apply the DDL for this object to the target databasestatic CreateIndex.Builder
builder()
Return a new Builder instance for creating instances of CreateIndexCreateIndexStatement
createStatement()
Build a CreateIndexStatement from this CreateIndex objectvoid
drop(ISchemaAdapter target)
DROP this object from the target databasejava.lang.String
getTableName()
Get the name of the table this index is built onjava.lang.String
getTypeNameVersion()
Get the qualified name for this object: objectType:objectName:objectVersionvoid
visit(DataModelVisitor v)
Visit thisIDatabaseObject
with the givenDataModelVisitor
.void
visitReverse(DataModelVisitor v)
Visit thisIDatabaseObject
with the givenDataModelVisitor
.-
Methods inherited from class org.linuxforhealth.fhir.database.utils.model.BaseObject
addDependencies, addDependency, addPrivilege, addTag, addTags, applyDistributionRules, applyTx, applyVersion, collect, equals, fetchDependenciesTo, getName, getObjectName, getObjectType, getQualifiedName, getSchemaName, getTags, getVersion, grant, grantGroupPrivileges, hashCode, toString, visit
-
-
-
-
Constructor Detail
-
CreateIndex
protected CreateIndex(java.lang.String schemaName, java.lang.String versionTrackingName, java.lang.String tableName, int version, IndexDef indexDef, java.lang.String tenantColumnName, DistributionType distributionType, java.lang.String distributionColumnName)
Protected constructor. Use the Builder to create instance.- Parameters:
schemaName
-indexName
-version
-distributionType
-
-
-
Method Detail
-
builder
public static CreateIndex.Builder builder()
Return a new Builder instance for creating instances of CreateIndex- Returns:
-
createStatement
public CreateIndexStatement createStatement()
Build a CreateIndexStatement from this CreateIndex object- Returns:
-
getTableName
public java.lang.String getTableName()
Get the name of the table this index is built on- Returns:
-
getTypeNameVersion
public java.lang.String getTypeNameVersion()
Description copied from interface:IDatabaseObject
Get the qualified name for this object: objectType:objectName:objectVersion- Specified by:
getTypeNameVersion
in interfaceIDatabaseObject
- Overrides:
getTypeNameVersion
in classBaseObject
- Returns:
-
apply
public void apply(ISchemaAdapter target, SchemaApplyContext context)
Description copied from interface:IDatabaseObject
Apply the DDL for this object to the target database- Parameters:
target
- the database targetcontext
- context to control the schema apply process
-
apply
public void apply(java.lang.Integer priorVersion, ISchemaAdapter target, SchemaApplyContext context)
Description copied from interface:IDatabaseObject
Apply migration logic to bring the target database to the current level of this objecttarget
- the database targetcontext
- to control the schema apply process
-
drop
public void drop(ISchemaAdapter target)
Description copied from interface:IDatabaseObject
DROP this object from the target database
-
visit
public void visit(DataModelVisitor v)
Description copied from interface:IDatabaseObject
Visit thisIDatabaseObject
with the givenDataModelVisitor
. Any sub-objects should be visited in creation order.
-
visitReverse
public void visitReverse(DataModelVisitor v)
Description copied from interface:IDatabaseObject
Visit thisIDatabaseObject
with the givenDataModelVisitor
. Any sub-objects should be visited in reverse order.
-
-