Class MsIndex
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsIndex
- All Implemented Interfaces:
IIndex,IOptionContainer,ISearchPath,ISimpleColumnContainer,ISimpleOptionContainer,IStatement,ISubElement,IHashable
Represents a Microsoft SQL index with support for clustered, non-clustered,
and columnstore indexes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(SimpleColumn column) Adds a column reference to this container.voidaddInclude(String include) Adds an included column to this container.voidAdds an option to this container.voidaddOrderCol(String orderCol) Adds a column to the ORDER clause for columnstore indexes.appendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typevoidbooleancompare(IStatement obj) This method does not account for nested child PgStatements.booleancompareColumns(Collection<String> refs) Compares the columns of this index with a collection of column references.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.Gets all options for this container.booleanbooleanisUnique()voidsetClustered(boolean isClustered) voidsetColumnstore(boolean isColumnstore) voidsetTablespace(String tablespace) voidsetUnique(boolean unique) voidMethods inherited from class org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
appendOwnerSQL, formatSql, getQuoter, getRenameCommand, getSeparator, isOwnedMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, addPrivilege, appendAlterComments, appendComments, appendPrivileges, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IIndex
getStatementType, toObjectReferenceMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISimpleOptionContainer
appendOptions, compareOptionsMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISubElement
getContainingSchema
-
Constructor Details
-
MsIndex
Creates a new Microsoft SQL index.- Parameters:
name- the index name
-
-
Method Details
-
getCreationSQL
Description copied from interface:IStatementGenerates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.- Specified by:
getCreationSQLin interfaceIStatement- Parameters:
script- the SQL script to append creation statements to
-
appendAlterSQL
Description copied from interface:IStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin interfaceIStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
compareColumns
Description copied from interface:IIndexCompares the columns of this index with a collection of column references.- Specified by:
compareColumnsin interfaceIIndex- Parameters:
refs- the collection of column references to compare against- Returns:
- true if the columns match in order and count
-
appendFullName
-
setColumnstore
public void setColumnstore(boolean isColumnstore) -
addOrderCol
Adds a column to the ORDER clause for columnstore indexes.- Parameters:
orderCol- the column specification for ordering
-
setTablespace
-
setWhere
-
setClustered
public void setClustered(boolean isClustered) -
setUnique
public void setUnique(boolean unique) -
getOptions
Description copied from interface:IOptionContainerGets all options for this container.- Specified by:
getOptionsin interfaceIOptionContainer- Returns:
- a map of option keys to values
-
addOption
Description copied from interface:IOptionContainerAdds an option to this container.- Specified by:
addOptionin interfaceIOptionContainer- Parameters:
key- the option keyvalue- the option value
-
isClustered
public boolean isClustered() -
addColumn
Description copied from interface:ISimpleColumnContainerAdds a column reference to this container.- Specified by:
addColumnin interfaceISimpleColumnContainer- Parameters:
column- the simple column to add
-
addInclude
Description copied from interface:ISimpleColumnContainerAdds an included column to this container.- Specified by:
addIncludein interfaceISimpleColumnContainer- Parameters:
include- the column name to include
-
getTablespace
-
isUnique
public boolean isUnique() -
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classAbstractStatement
-