Class QuerySequence

All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
EISSequence, NativeSequence, TableSequence, UnaryTableSequence

public class QuerySequence extends StandardSequence

Purpose: An generic query sequence mechanism.

Description This sequence allows the sequence operations to be customized through user defined queries. A select and update query can be set which can use custom SQL or stored procedures to define the sequencing mechanism. If a single stored procedure is used that does the update and select only the select query needs to be set.

See Also:
  • Field Details

    • selectQuery

      protected ValueReadQuery selectQuery
    • updateQuery

      protected DataModifyQuery updateQuery
    • shouldAcquireValueAfterInsert

      protected boolean shouldAcquireValueAfterInsert
    • shouldUseTransaction

      protected boolean shouldUseTransaction
    • shouldSkipUpdate

      protected boolean shouldSkipUpdate
    • shouldSelectBeforeUpdate

      protected boolean shouldSelectBeforeUpdate
    • wasSelectQueryCreated

      protected boolean wasSelectQueryCreated
    • wasUpdateQueryCreated

      protected boolean wasUpdateQueryCreated
  • Constructor Details

    • QuerySequence

      public QuerySequence()
    • QuerySequence

      public QuerySequence(String name)
      Create a new sequence with the name.
    • QuerySequence

      public QuerySequence(String name, int size)
      Create a new sequence with the name and sequence pre-allocation size.
    • QuerySequence

      public QuerySequence(String name, int size, int initialValue)
    • QuerySequence

      public QuerySequence(boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
    • QuerySequence

      public QuerySequence(String name, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
    • QuerySequence

      public QuerySequence(String name, int size, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
    • QuerySequence

      public QuerySequence(String name, int size, int initialValue, boolean shouldAcquireValueAfterInsert, boolean shouldUseTransaction)
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Sequence
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Sequence
    • shouldAcquireValueAfterInsert

      public boolean shouldAcquireValueAfterInsert()
      PUBLIC:
      Specified by:
      shouldAcquireValueAfterInsert in class StandardSequence
    • setShouldAcquireValueAfterInsert

      public void setShouldAcquireValueAfterInsert(boolean shouldAcquireValueAfterInsert)
      PUBLIC:
    • shouldUseTransaction

      public boolean shouldUseTransaction()
      PUBLIC:
      Specified by:
      shouldUseTransaction in class StandardSequence
    • setShouldUseTransaction

      public void setShouldUseTransaction(boolean shouldUseTransaction)
      PUBLIC:
    • setSelectQuery

      public void setSelectQuery(ValueReadQuery query)
      PUBLIC:
    • getSelectQuery

      public ValueReadQuery getSelectQuery()
      PUBLIC:
    • setUpdateQuery

      public void setUpdateQuery(DataModifyQuery query)
      PUBLIC:
    • getUpdateQuery

      public DataModifyQuery getUpdateQuery()
      PUBLIC:
    • setShouldSkipUpdate

      public void setShouldSkipUpdate(boolean shouldSkipUpdate)
      PUBLIC:
    • shouldSkipUpdate

      public boolean shouldSkipUpdate()
      PUBLIC:
    • setShouldSelectBeforeUpdate

      public void setShouldSelectBeforeUpdate(boolean shouldSelectBeforeUpdate)
      PUBLIC:
    • shouldSelectBeforeUpdate

      public boolean shouldSelectBeforeUpdate()
      PUBLIC:
    • buildSelectQuery

      protected ValueReadQuery buildSelectQuery()
      INTERNAL:
    • buildUpdateQuery

      protected DataModifyQuery buildUpdateQuery()
      INTERNAL:
    • buildSelectQuery

      protected ValueReadQuery buildSelectQuery(String seqName, Integer size)
      INTERNAL:
    • buildUpdateQuery

      protected DataModifyQuery buildUpdateQuery(String seqName, Number sizeOrNewValue)
      INTERNAL:
    • onConnect

      public void onConnect()
      INTERNAL:
      Overrides:
      onConnect in class StandardSequence
    • onDisconnect

      public void onDisconnect()
      INTERNAL:
      Overrides:
      onDisconnect in class StandardSequence
    • updateAndSelectSequence

      protected Number updateAndSelectSequence(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, int size)
      INTERNAL:
      Specified by:
      updateAndSelectSequence in class StandardSequence
    • select

      protected Object select(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, Integer size)
      INTERNAL:
    • update

      protected void update(org.eclipse.persistence.internal.databaseaccess.Accessor accessor, org.eclipse.persistence.internal.sessions.AbstractSession writeSession, String seqName, Number sizeOrNewValue)
      INTERNAL:
    • createArguments

      protected Vector createArguments(DatabaseQuery query, String seqName, Number sizeOrNewValue)
      INTERNAL: