Package org.pgcodekeeper.core.schema
Class AbstractSequence
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractSequence
- All Implemented Interfaces:
IHashable,IRelation,ISearchPath,IStatement
- Direct Known Subclasses:
MsSequence,PgSequence
Abstract base class for database sequences.
Provides common functionality for auto-incrementing sequences across different database types.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Method Summary
Modifier and TypeMethodDescriptionbooleancompare(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.abstract voidfillSequenceBody(StringBuilder sbSQL) Fills the sequence body SQL definition.Gets the schema that contains this object.Gets the columns of this relation as name-type pairs.Gets the type of this database object.voidvoidsetCycle(boolean cycle) voidsetDataType(String dataType) abstract voidsetMinMaxInc(long inc, Long max, Long min, String dataType, long precision) Sets the minimum, maximum, and increment values for this sequence.voidsetStartWith(String startWith) Copies all object properties into a new object and leaves all its children empty.Methods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendAlterSQL, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDbType, 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
-
Method Details
-
getStatementType
Description copied from interface:IStatementGets the type of this database object.- Specified by:
getStatementTypein interfaceIStatement- Returns:
- the database object type
-
setCache
-
getRelationColumns
Description copied from interface:IRelationGets the columns of this relation as name-type pairs.- Specified by:
getRelationColumnsin interfaceIRelation- Returns:
- a stream of column name and type pairs
-
setCycle
public void setCycle(boolean cycle) -
setMinMaxInc
Sets the minimum, maximum, and increment values for this sequence.- Parameters:
inc- the increment valuemax- the maximum valuemin- the minimum valuedataType- the data type of the sequenceprecision- the precision for numeric types
-
setStartWith
-
setDataType
-
getDataType
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classPgStatement
-
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
-
shallowCopy
Description copied from class:PgStatementCopies all object properties into a new object and leaves all its children empty.- Specified by:
shallowCopyin classPgStatement- Returns:
- shallow copy of a DB object.
-
fillSequenceBody
Fills the sequence body SQL definition.- Parameters:
sbSQL- the StringBuilder to append the sequence body to
-
getContainingSchema
Description copied from interface:ISearchPathGets the schema that contains this object.- Specified by:
getContainingSchemain interfaceISearchPath- Returns:
- the containing schema
-