Package org.sqlproc.engine.impl
Class SqlType
java.lang.Object
org.sqlproc.engine.impl.SqlType
The SQL type of a dynamic input value (SQL statement parameter) or an output value (SQL query scalar).
- Author:
- Vladimir Hudec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.LoggerThe internal type, which means special processing of the input/output value.private SqlMetaTypeThe internal META type, which means special processing of the input/output value.private StringThe name of the internal META type.private StringRight now only for the special of the enumeration type of the input value. -
Constructor Summary
ConstructorsConstructorDescriptionSqlType()Creates a new instance with unspecified internal type.SqlType(String metaTypeName, SqlMetaType metaType) Creates a new instance with specified internal type. -
Method Summary
Modifier and TypeMethodDescription(package private) SqlMetaTypeReturns the internal type.Returns the name of the internal META type.(package private) ObjectgetResult(SqlProcessContext ctx, String attributeName, Object resultValue) Returns the attribute's result value (with possible conversion).getValue()Returns the value.(package private) voidsetParameter(SqlProcessContext ctx, SqlQuery query, String paramName, Object inputValue, Class<?>... inputTypes) Bind an input value to a named query parameter.(package private) voidsetResult(SqlProcessContext ctx, Object resultInstance, String attributeName, Object resultValue) Initializes the attribute of the result class with output values from SQL query execution.voidSets the value.toString()For debug purposes.
-
Field Details
-
logger
protected final org.slf4j.Logger loggerThe internal type, which means special processing of the input/output value. -
metaTypeName
The name of the internal META type. -
metaType
The internal META type, which means special processing of the input/output value. -
value
Right now only for the special of the enumeration type of the input value. The logical evaluation of the input value is based on the comparison to this value.
-
-
Constructor Details
-
SqlType
SqlType()Creates a new instance with unspecified internal type. -
SqlType
SqlType(String metaTypeName, SqlMetaType metaType) Creates a new instance with specified internal type.- Parameters:
metaTypeName- the internal type namemetaType- the internal type
-
-
Method Details
-
getMetaTypeName
Returns the name of the internal META type.- Returns:
- the name of the internal META type
-
getMetaType
Returns the internal type.- Parameters:
ctx- the crate for all input parameters and the context of processing- Returns:
- the internal type
-
setResult
void setResult(SqlProcessContext ctx, Object resultInstance, String attributeName, Object resultValue) throws SqlRuntimeException Initializes the attribute of the result class with output values from SQL query execution.- Parameters:
ctx- the crate for all input parameters and the context of processingresultInstance- the instance of the result classattributeName- the name of the attribute in the result classresultValue- Query execution output value- Throws:
SqlRuntimeException- in the case of any problem with output values handling
-
getResult
Object getResult(SqlProcessContext ctx, String attributeName, Object resultValue) throws SqlRuntimeException Returns the attribute's result value (with possible conversion).- Parameters:
ctx- the crate for all input parameters and the context of processingattributeName- the name of the attribute in the result classresultValue- Query execution output value- Throws:
SqlRuntimeException- in the case of any problem with output values handling
-
setParameter
void setParameter(SqlProcessContext ctx, SqlQuery query, String paramName, Object inputValue, Class<?>... inputTypes) throws SqlRuntimeException Bind an input value to a named query parameter.- Parameters:
ctx- the crate for all input parameters and the context of processingquery- the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staffparamName- the name of the parameterinputTypes- the Java types of the attribute in the input POJO- Throws:
SqlRuntimeException- in the case of any problem with input values handling
-
getValue
Returns the value. Right now only for the special of the enumeration type of the input value. The logical evaluation of the input value is based on the comparison to this value.- Returns:
- the value for special enumeration treatment
-
setValue
Sets the value. Right now only for the special of the enumeration type of the input value. The logical evaluation of the input value is based on the comparison to this value.- Parameters:
value- the value for special enumeration treatment
-
toString
For debug purposes.
-