Enum SequenceMode

java.lang.Object
java.lang.Enum<SequenceMode>
com.smartgwt.client.types.SequenceMode
All Implemented Interfaces:
ValueEnum, Serializable, Comparable<SequenceMode>, Constable

public enum SequenceMode extends 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 Details

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

    • values

      public static SequenceMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SequenceMode valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Specified by:
      getValue in interface ValueEnum