Class DB2SequenceSupport

java.lang.Object
org.hibernate.dialect.sequence.spi.ANSISequenceSupport
org.hibernate.dialect.sequence.spi.DB2SequenceSupport
All Implemented Interfaces:
SequenceSupport

@SPI({USE,IMPLEMENT}) public class DB2SequenceSupport extends ANSISequenceSupport

Db2/Derby family base using ANSI value expressions, values stand-alone selection, and restrictive sequence drop syntax.

Extend this class for a family member which retains those common rules and override only its differing DDL or value-selection methods.

Since:
8.0
  • Constructor Details

    • DB2SequenceSupport

      @SPI(IMPLEMENT) public DB2SequenceSupport()
      Create a Db2-family strategy or provider subclass.
  • Method Details

    • getSequenceNextValString

      public String getSequenceNextValString(String sequenceName)
      Description copied from interface: SequenceSupport
      Render a stand-alone statement which obtains the next sequence value.
      Parameters:
      sequenceName - the qualified sequence name
      Returns:
      the next-value statement
    • getSelectSequencePreviousValString

      public String getSelectSequencePreviousValString(String sequenceName) throws MappingException
      Description copied from interface: SequenceSupport
      Render the expression which obtains the previous value inside another SQL statement. Override this method only when the database exposes such an expression.
      Specified by:
      getSelectSequencePreviousValString in interface SequenceSupport
      Overrides:
      getSelectSequencePreviousValString in class ANSISequenceSupport
      Parameters:
      sequenceName - the qualified sequence name
      Returns:
      the previous-value expression
      Throws:
      MappingException - when the operation is unsupported
    • getSequencePreviousValString

      public String getSequencePreviousValString(String sequenceName)
      Description copied from interface: SequenceSupport
      Render a stand-alone statement which obtains the previous sequence value.
      Parameters:
      sequenceName - the qualified sequence name
      Returns:
      the previous-value statement
    • getDropSequenceString

      public String getDropSequenceString(String sequenceName)
      Description copied from interface: SequenceSupport
      Render the single command which drops a sequence. Override the multi-command form instead when one logical drop requires several commands.
      Parameters:
      sequenceName - the qualified sequence name
      Returns:
      the sequence-drop command