Enum LiteralHandlingMode

  • All Implemented Interfaces:
    Serializable, Comparable<LiteralHandlingMode>

    public enum LiteralHandlingMode
    extends Enum<LiteralHandlingMode>
    This enum defines how literals are handled by JPA Criteria. By default (AUTO), Criteria queries uses bind parameters for any literal that is not a numeric value. However, to increase the likelihood of JDBC statement caching, you might want to use bind parameters for numeric values too. The BIND mode will use bind variables for any literal value. The INLINE mode will inline literal values as-is. To prevent SQL injection, never use INLINE with String variables. Always use constants with the INLINE mode.
    • Method Detail

      • values

        public static LiteralHandlingMode[] 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 (LiteralHandlingMode c : LiteralHandlingMode.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LiteralHandlingMode 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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • interpret

        public static LiteralHandlingMode interpret​(Object literalHandlingMode)
        Interpret the configured literalHandlingMode value. Valid values are either a LiteralHandlingMode object or its String representation. For string values, the matching is case insensitive, so you can use either AUTO or auto.
        literalHandlingMode - configured LiteralHandlingMode representation
        associated LiteralHandlingMode object