Package org.pgcodekeeper.core.schema.ms
Class MsSequence
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractSequence
org.pgcodekeeper.core.schema.ms.MsSequence
- All Implemented Interfaces:
IHashable,IRelation,ISearchPath,IStatement
Represents a Microsoft SQL sequence object.
Sequences generate sequential numeric values and are commonly used for primary keys and unique identifiers.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
ConstructorsConstructorDescriptionMsSequence(String name) Creates a new Microsoft SQL sequence with BIGINT data type as default. -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(PgStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.voidfillSequenceBody(StringBuilder sbSQL) Fills the sequence body SQL definition.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.voidsetCached(boolean isCached) voidsetDataType(String dataType) voidsetMinMaxInc(long inc, Long max, Long min, String dataType, long precision) Sets the minimum, maximum, and increment values for this sequence.Methods inherited from class org.pgcodekeeper.core.schema.AbstractSequence
getContainingSchema, getDataType, getRelationColumns, getStatementType, setCache, setCycle, setStartWith, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Constructor Details
-
MsSequence
Creates a new Microsoft SQL sequence with BIGINT data type as default.- Parameters:
name- the sequence name
-
-
Method Details
-
getCreationSQL
Description copied from class:PgStatementGenerates 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 classPgStatement- Parameters:
script- the SQL script to append creation statements to
-
fillSequenceBody
Description copied from class:AbstractSequenceFills the sequence body SQL definition.- Specified by:
fillSequenceBodyin classAbstractSequence- Parameters:
sbSQL- the StringBuilder to append the sequence body to
-
appendAlterSQL
Description copied from class:PgStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin classPgStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
setDataType
- Overrides:
setDataTypein classAbstractSequence
-
setMinMaxInc
Description copied from class:AbstractSequenceSets the minimum, maximum, and increment values for this sequence.- Specified by:
setMinMaxIncin classAbstractSequence- Parameters:
inc- the increment valuemax- the maximum valuemin- the minimum valuedataType- the data type of the sequenceprecision- the precision for numeric types
-
setCached
public void setCached(boolean isCached) -
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractSequence
-
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- Overrides:
computeHashin classAbstractSequence- Parameters:
hasher- the hasher instance to use for hash computation
-
getDbType
- Overrides:
getDbTypein classPgStatement
-