class SqlInputValue extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SqlInputValue.Code
Enumeration for no/upper/lower case conversion.
|
(package private) static class |
SqlInputValue.Mode
Enumeration for IN/OUT/INOUT mode of callable statement parameter.
|
(package private) static class |
SqlInputValue.Type
Enumeration for the type of input value.
|
Modifier and Type | Field and Description |
---|---|
private SqlInputValue.Code |
caseConversion
Which conversion should be done on inputValue.
|
private SqlProcessContext |
ctx
the crate for all input parameters and the context of processing.
|
private String |
dbIdentityName
A database identity column name
|
private String |
fullInputName
A input attribute full name.
|
private Object |
identity
A calculated identity.
|
private String |
identitySelect
An SQL select for an identity column.
|
private SqlInputValue.Mode |
inOutMode
Which mode of callable statement parameter it is.
|
private String |
inputName
A input attribute name.
|
private Object |
inputValue
A dynamic input value.
|
(package private) Class<?>[] |
inputValueTypes
The input value Java types (including parameterized types).
|
private Boolean |
inSetOrInsert
The indicator the input value is bounded to the SET or VALUES fragment of META SQL
|
private String |
likeChar
A wildcard character for the SQL command
LIKE . |
(package private) org.slf4j.Logger |
logger
The internal slf4j logger.
|
private int |
minLikeLength
The minimum length of inputValue to enable likeChar special treatment.
|
private Object |
outValue
A dynamic input value can be also an output value.
|
private Object |
parentInputValue
A parent of a dynamic input value.
|
private boolean |
partialLike
a wildcard character is going to be only a postfix
|
private Map<String,String> |
replaceChars
A map of characters to be replaced in input value;
|
private String |
sequence
A database sequence for an identity column.
|
private SqlType |
type
The input value META type.
|
private SqlInputValue.Type |
valueType
The type of the input value, please see
SqlInputValue.Type . |
Constructor and Description |
---|
SqlInputValue(SqlProcessContext ctx,
SqlInputValue.Type valueType,
Object inputValue,
Object parentInputValue,
SqlInputValue.Code caseConversion,
SqlInputValue.Mode inOutMode,
SqlType type,
String inputName,
String fullInputName,
Boolean inSetOrInsert,
Class<?>... inputValueTypes)
Creates a new instance of this entity.
|
SqlInputValue(SqlProcessContext ctx,
SqlInputValue.Type valueType,
Object inputValue,
Object parentInputValue,
String sequenceOrIdentitySelect,
SqlType type,
String dbIdentityName,
Class<?>... inputValueTypes)
Creates a new instance of this entity.
|
SqlInputValue(SqlProcessContext ctx,
String name,
SqlInputValue sqlInputValue,
Object dynamicInputValues)
Creates a new instance of this entity.
|
Modifier and Type | Method and Description |
---|---|
String |
getDbIdentityName()
Returns a database identity column name.
|
(package private) String |
getInputName()
Returns a input attribute name.
|
(package private) Object |
getInputValue()
Returns a dynamic input value.
|
Boolean |
getInSetOrInsert()
Returns the indicator the input value is bounded to the SET or VALUES fragment of META SQL
|
(package private) Object |
getParentInputValue()
Returns a parent of a dynamic input value.
|
SqlInputValue.Type |
getValueType()
Returns the type of the input value, please see
SqlInputValue.Type . |
private String |
processLike(Object val)
A special treatment of dynamic input value for SQL command
LIKE . |
private String |
processReplaceChars(Object val)
A special treatment of dynamic input value for SQL command
LIKE . |
(package private) void |
setIdentityResult(String paramName)
Sets the generated identity value to an input value attribute.
|
(package private) void |
setLike(String likeChar,
Integer minLikeLength,
boolean partialLike)
Sets a special treatment of a dynamic input value.
|
(package private) void |
setOutValueResult(String paramName)
Sets the OUT/INOUT value to an input value attribute.
|
(package private) void |
setQueryParam(SqlTypeFactory typeFactory,
SqlSession session,
SqlQuery query,
String paramName)
Bind a dynamic input value to a named query parameter.
|
(package private) void |
setReplaceChars(Map<String,String> replaceChars)
Sets a special treatment of a dynamic input value.
|
String |
toString()
For debug purposes.
|
final org.slf4j.Logger logger
private SqlProcessContext ctx
private SqlInputValue.Type valueType
SqlInputValue.Type
.private SqlInputValue.Code caseConversion
private SqlInputValue.Mode inOutMode
private Object inputValue
private String inputName
private String fullInputName
private Object parentInputValue
Class<?>[] inputValueTypes
private String likeChar
LIKE
. It can be added to inputValue as a prefix and/or as a
suffix.private int minLikeLength
private boolean partialLike
private SqlType type
private String sequence
private String identitySelect
private Object identity
private Object outValue
private Map<String,String> replaceChars
private String dbIdentityName
private Boolean inSetOrInsert
SqlInputValue(SqlProcessContext ctx, SqlInputValue.Type valueType, Object inputValue, Object parentInputValue, SqlInputValue.Code caseConversion, SqlInputValue.Mode inOutMode, SqlType type, String inputName, String fullInputName, Boolean inSetOrInsert, Class<?>... inputValueTypes)
ctx
- the crate for all input parameters and the context of processingvalueType
- a value typeinputValue
- a dynamic input valuecaseConversion
- which conversion should be done on inputValueinOutMode
- Which mode of callable statement parameter it istype
- a dynamic input value META typeinSetOrInsert
- an indicator the input value is bounded to the SET or VALUES fragment of META SQLinputValueTypes
- a dynamic input value Java types (including parameterized types)SqlInputValue(SqlProcessContext ctx, SqlInputValue.Type valueType, Object inputValue, Object parentInputValue, String sequenceOrIdentitySelect, SqlType type, String dbIdentityName, Class<?>... inputValueTypes)
ctx
- the crate for all input parameters and the context of processingvalueType
- a value typeinputValue
- a dynamic input valuesequenceOrIdentitySelect
- a sequence or select command used to generate an identity valuetype
- a dynamic input value META typeinputValueTypes
- a dynamic input value Java types (including parameterized types)SqlInputValue(SqlProcessContext ctx, String name, SqlInputValue sqlInputValue, Object dynamicInputValues)
ctx
- the crate for all input parameters and the context of processingname
- the name og the attributesqlInputValue
- SqlInputValue instance to clonedynamicInputValues
- the SQL statement dynamic parameters (input values)void setQueryParam(SqlTypeFactory typeFactory, SqlSession session, SqlQuery query, String paramName) throws SqlRuntimeException
typeFactory
- the SQL Type factorysession
- the SQL Engine session, an adapter or proxy to the internal JDBC or ORM staffquery
- the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staffparamName
- the name of the parameter (= the attribute name)SqlRuntimeException
- in the case of any problem with input values handlingvoid setIdentityResult(String paramName) throws SqlRuntimeException
paramName
- the name of the parameter (= the attribute name)SqlRuntimeException
- in the case of any problem with output values handlingvoid setOutValueResult(String paramName) throws SqlRuntimeException
paramName
- the name of the parameter (= the attribute name)SqlRuntimeException
- in the case of any problem with output values handlingvoid setLike(String likeChar, Integer minLikeLength, boolean partialLike)
likeChar
- a wildcard characterminLikeLength
- the minimum length of inputValue to enable likeChar special treatmentpartialLike
- a wildcard character is going to be only a postfixvoid setReplaceChars(Map<String,String> replaceChars)
replaceChars
- a map of characters to be replaced in input valueprivate String processLike(Object val)
LIKE
.val
- a dynamic input valueprivate String processReplaceChars(Object val)
LIKE
.val
- a dynamic input valueObject getInputValue()
String getInputName()
Object getParentInputValue()
public SqlInputValue.Type getValueType()
SqlInputValue.Type
.SqlInputValue.Type
public String getDbIdentityName()
public Boolean getInSetOrInsert()
Copyright © 2016. All rights reserved.