Class QuerySequence

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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​(java.lang.String name)
        Create a new sequence with the name.
      • QuerySequence

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

        public QuerySequence​(java.lang.String name,
                             int size,
                             int initialValue)
      • QuerySequence

        public QuerySequence​(boolean shouldAcquireValueAfterInsert,
                             boolean shouldUseTransaction)
      • QuerySequence

        public QuerySequence​(java.lang.String name,
                             boolean shouldAcquireValueAfterInsert,
                             boolean shouldUseTransaction)
      • QuerySequence

        public QuerySequence​(java.lang.String name,
                             int size,
                             boolean shouldAcquireValueAfterInsert,
                             boolean shouldUseTransaction)
      • QuerySequence

        public QuerySequence​(java.lang.String name,
                             int size,
                             int initialValue,
                             boolean shouldAcquireValueAfterInsert,
                             boolean shouldUseTransaction)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Sequence
      • 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:
      • buildSelectQuery

        protected ValueReadQuery buildSelectQuery​(java.lang.String seqName,
                                                  java.lang.Integer size)
        INTERNAL:
      • buildUpdateQuery

        protected DataModifyQuery buildUpdateQuery​(java.lang.String seqName,
                                                   java.lang.Number sizeOrNewValue)
        INTERNAL:
      • updateAndSelectSequence

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

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

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

        protected java.util.Vector createArguments​(DatabaseQuery query,
                                                   java.lang.String seqName,
                                                   java.lang.Number sizeOrNewValue)
        INTERNAL: