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

public abstract class AbstractSequence extends PgStatement implements IRelation, ISearchPath
Abstract base class for database sequences. Provides common functionality for auto-incrementing sequences across different database types.
  • Method Details

    • getStatementType

      public DbObjType getStatementType()
      Description copied from interface: IStatement
      Gets the type of this database object.
      Specified by:
      getStatementType in interface IStatement
      Returns:
      the database object type
    • setCache

      public void setCache(String cache)
    • getRelationColumns

      public Stream<Pair<String,String>> getRelationColumns()
      Description copied from interface: IRelation
      Gets the columns of this relation as name-type pairs.
      Specified by:
      getRelationColumns in interface IRelation
      Returns:
      a stream of column name and type pairs
    • setCycle

      public void setCycle(boolean cycle)
    • setMinMaxInc

      public abstract void setMinMaxInc(long inc, Long max, Long min, String dataType, long precision)
      Sets the minimum, maximum, and increment values for this sequence.
      Parameters:
      inc - the increment value
      max - the maximum value
      min - the minimum value
      dataType - the data type of the sequence
      precision - the precision for numeric types
    • setStartWith

      public void setStartWith(String startWith)
    • setDataType

      public void setDataType(String dataType)
    • getDataType

      public String getDataType()
    • compare

      public boolean compare(PgStatement obj)
      Description copied from class: PgStatement
      This method does not account for nested child PgStatements. Shallow version of PgStatement.equals(Object)
      Overrides:
      compare in class PgStatement
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Specified by:
      computeHash in interface IHashable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • shallowCopy

      public AbstractSequence shallowCopy()
      Description copied from class: PgStatement
      Copies all object properties into a new object and leaves all its children empty.
      Specified by:
      shallowCopy in class PgStatement
      Returns:
      shallow copy of a DB object.
    • fillSequenceBody

      public abstract void fillSequenceBody(StringBuilder sbSQL)
      Fills the sequence body SQL definition.
      Parameters:
      sbSQL - the StringBuilder to append the sequence body to
    • getContainingSchema

      public AbstractSchema getContainingSchema()
      Description copied from interface: ISearchPath
      Gets the schema that contains this object.
      Specified by:
      getContainingSchema in interface ISearchPath
      Returns:
      the containing schema