Class MsColumn
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsColumn
- All Implemented Interfaces:
IColumn,ISearchPath,IStatement,ISubElement,IHashable
Represents a Microsoft SQL table column with its properties and constraints.
Handles column-specific features like SPARSE, ROWGUIDCOL, PERSISTED, identity columns,
generated columns, and data masking functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(IStatement obj) This method does not account for nested child PgStatements.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.voidgetDropSQL(SQLScript script, boolean optionExists) Generates DROP SQL for this statement.getType()booleanbooleanvoidsetCollation(String collation) voidsetDefaultName(String defaultName) voidsetDefaultValue(String defaultValue) voidsetExpression(String expression) voidsetGenerated(MsGeneratedType generated) voidsetHidden(boolean isHidden) voidsetIdentity(String seed, String increment) Configures this column as an identity column with the specified seed and increment values.voidsetMaskingFunction(String maskingFunction) voidsetNotForRep(boolean isNotForRep) voidsetNotNull(boolean notNull) voidsetPersisted(boolean isPersisted) voidsetRowGuidCol(boolean isRowGuidCol) voidsetSparse(boolean isSparse) 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, 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.IColumn
getStatementTypeMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, 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, toObjectReference
-
Constructor Details
-
MsColumn
Creates a new Microsoft SQL column with the specified name.- Parameters:
name- the column 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
-
getFullDefinition
-
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
-
getDropSQL
Description copied from interface:IStatementGenerates DROP SQL for this statement.- Specified by:
getDropSQLin interfaceIStatement- Overrides:
getDropSQLin classAbstractStatement- Parameters:
script- the SQL script to append the DROP statement tooptionExists- whether to include "IF EXISTS" in the DROP statement
-
setSparse
public void setSparse(boolean isSparse) -
setRowGuidCol
public void setRowGuidCol(boolean isRowGuidCol) -
setPersisted
public void setPersisted(boolean isPersisted) -
setNotForRep
public void setNotForRep(boolean isNotForRep) -
getDefaultName
-
setDefaultName
-
getExpression
-
setExpression
-
setMaskingFunction
-
isIdentity
public boolean isIdentity() -
setIdentity
Configures this column as an identity column with the specified seed and increment values.- Parameters:
seed- the starting value for the identityincrement- the increment value for each new identity value
-
getGenerated
-
setGenerated
-
setHidden
public void setHidden(boolean isHidden) -
setDefaultValue
-
setNotNull
public void setNotNull(boolean notNull) -
setCollation
-
setType
-
getType
-
isNotNull
public boolean isNotNull() -
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
-