Enum LiteralHandlingMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<LiteralHandlingMode>

    public enum LiteralHandlingMode
    extends java.lang.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.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AUTO  
      BIND  
      INLINE  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static LiteralHandlingMode interpret​(java.lang.Object literalHandlingMode)
      Interpret the configured literalHandlingMode value.
      static LiteralHandlingMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static LiteralHandlingMode[] 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
    • 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())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LiteralHandlingMode 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
      • interpret

        public static LiteralHandlingMode interpret​(java.lang.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.
        Parameters:
        literalHandlingMode - configured LiteralHandlingMode representation
        Returns:
        associated LiteralHandlingMode object