public enum LiteralHandlingMode extends Enum<LiteralHandlingMode>
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.Modifier and Type | Method and Description |
---|---|
static LiteralHandlingMode |
interpret(Object literalHandlingMode)
Interpret the configured literalHandlingMode value.
|
static LiteralHandlingMode |
valueOf(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.
|
public static final LiteralHandlingMode AUTO
public static final LiteralHandlingMode BIND
public static final LiteralHandlingMode INLINE
public static LiteralHandlingMode[] values()
for (LiteralHandlingMode c : LiteralHandlingMode.values()) System.out.println(c);
public static LiteralHandlingMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static LiteralHandlingMode interpret(Object literalHandlingMode)
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
representationLiteralHandlingMode
objectCopyright © 2019 JBoss by Red Hat. All rights reserved.