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:
    Serialized Form
    • Field Detail

      • 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 Detail

      • 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 Detail

      • setShouldAcquireValueAfterInsert

        public void setShouldAcquireValueAfterInsert​(boolean shouldAcquireValueAfterInsert)
        PUBLIC:
      • setShouldUseTransaction

        public void setShouldUseTransaction​(boolean shouldUseTransaction)
        PUBLIC:
      • setSelectQuery

        public void setSelectQuery​(ValueReadQuery query)
        PUBLIC:
      • setUpdateQuery

        public void setUpdateQuery​(DataModifyQuery query)
        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:
      • 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: