com.smartgwt.client.types

## Enum SequenceMode

- java.lang.Object
- - java.lang.Enum<SequenceMode>
  - - com.smartgwt.client.types.SequenceMode

- All Implemented Interfaces:
    ValueEnum, java.io.Serializable, java.lang.Comparable<SequenceMode>

      public enum SequenceMode
      extends java.lang.Enum<SequenceMode>
      implements ValueEnum

  The possible types of sequence handling Smart GWT Server can apply. This refers to the technique used to obtain the primary keys of the most recent insert, which the product uses to enable automatic cache synchronization (updating client-side components bound to a dataSource to reflect updates to that dataSource). Only applicable to `fields` of `type` "sequence".

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `JDBCDRIVER` Use the JDBC 3.0 API "getGeneratedKeys()" to get the most recent sequence value.
    `NATIVE` Use a database-specific native technique to obtain the most recent sequence value.
    `NONE` No automatic attempt is made to retrieve the most recent sequence value.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getValue()`
    `static SequenceMode` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static SequenceMode[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### JDBCDRIVER

          public static final SequenceMode JDBCDRIVER

      Use the JDBC 3.0 API "getGeneratedKeys()" to get the most recent sequence value. Obviously, this is only an option for JDBC 3.0+ drivers

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "jdbcDriver".

    - #### NATIVE

          public static final SequenceMode NATIVE

      Use a database-specific native technique to obtain the most recent sequence value. The actual technique used varies widely depending on the vagaries of the underlying database (and sometimes the vagaries of particular releases of a database product)

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "native".

    - #### NONE

          public static final SequenceMode NONE

      No automatic attempt is made to retrieve the most recent sequence value. You are expected to handle this by providing a `cacheSyncOperation` that is able to return the entire row without needing generated PK values for context. For example, a query that uses `MAX(pk)` would be capable of this. To give a more complex example, say you have a sequence value that is retrieved from a legacy system: you could store that sequence value in the HTTP session and then have your custom `cacheSyncOperation` reference that session attribute in its `WHERE` clause. Also note that cacheSyncOperations, like any other `DataSource operation`, can be `written in Java` or any `JSR223-compliant scripting language` - you do not have to use SQL

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "none".

  - ### Method Detail

    - #### values

          public static SequenceMode[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (SequenceMode c : SequenceMode.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static SequenceMode valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getValue

          public java.lang.String getValue()

      Specified by:
        `getValue` in interface `ValueEnum`