Package org.hibernate.query.criteria
Enum LiteralHandlingMode
- java.lang.Object
-
- java.lang.Enum<LiteralHandlingMode>
-
- org.hibernate.query.criteria.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. TheBIND
mode will use bind variables for any literal value. TheINLINE
mode will inline literal values as-is. To prevent SQL injection, never useINLINE
with String variables. Always use constants with theINLINE
mode.
-
-
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.
-
-
-
Enum Constant Detail
-
AUTO
public static final LiteralHandlingMode AUTO
-
BIND
public static final LiteralHandlingMode BIND
-
INLINE
public static final LiteralHandlingMode INLINE
-
-
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 namejava.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 aLiteralHandlingMode
object or its String representation. For string values, the matching is case insensitive, so you can use eitherAUTO
orauto
.- Parameters:
literalHandlingMode
- configuredLiteralHandlingMode
representation- Returns:
- associated
LiteralHandlingMode
object
-
-