Package org.sqlproc.engine.type
Interface SqlMetaType
- All Known Subinterfaces:
SqlTaggedMetaType
- All Known Implementing Classes:
JdbcBigDecimalType,JdbcBigIntegerType,JdbcBlobType,JdbcBooleanType,JdbcByteArrayType,JdbcByteArrayWrapperType,JdbcByteType,JdbcCharType,JdbcClobType,JdbcDateTimeType,JdbcDateType,JdbcDefaultType,JdbcDoubleType,JdbcEnumIntegerType,JdbcEnumStringType,JdbcFloatType,JdbcFromDateType,JdbcInstantType,JdbcIntegerType,JdbcLocalDateTimeType,JdbcLocalDateType,JdbcLocalTimeType,JdbcLongType,JdbcOracleCursorType,JdbcOtherType,JdbcShortType,JdbcStringType,JdbcTextType,JdbcTimestampType,JdbcTimeType,JdbcToDateType,SqlBigDecimalType,SqlBigIntegerType,SqlBlobType,SqlBooleanType,SqlByteArrayType,SqlByteType,SqlCharType,SqlClobType,SqlDateTimeType,SqlDateType,SqlDefaultType,SqlDoubleType,SqlEnumIntegerType,SqlEnumStringType,SqlFloatType,SqlFromDateType,SqlIdentityType,SqlInstantType,SqlIntegerType,SqlLocalDateTimeType,SqlLocalDateType,SqlLocalTimeType,SqlLongType,SqlOutValueType,SqlShortType,SqlStringType,SqlTextType,SqlTimestampType,SqlTimeType,SqlToDateType
public interface SqlMetaType
The common ancestor of all META types. These internal types are devoted for the special processing of the
input/output values.
- Author:
- Vladimir Hudec
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddScalar(SqlTypeFactory typeFactory, SqlQuery query, String dbName, Class<?>... attributeTypes) Declares a scalar query result, which is an SQL query execution output value.default voidaddScalarEntryLog(org.slf4j.Logger logger, SqlMetaType sqlMetaType, SqlTypeFactory typeFactory, SqlQuery query, String dbName, Class<?>... attributeTypes) default voidLog or throw error.Returns the type provided by the stack on top of which the SQL Processor works.default ObjectgetResult(SqlRuntimeContext runtimeCtx, String attributeName, Object resultValue, boolean ingoreError) Returns the attribute's result value (with possible conversion).voidsetParameter(SqlRuntimeContext runtimeCtx, SqlQuery query, String paramName, Object inputValue, boolean ingoreError, Class<?>... inputTypes) Binds an input value to a named query parameter.default voidsetParameterEntryLog(org.slf4j.Logger logger, SqlMetaType sqlMetaType, SqlRuntimeContext runtimeCtx, SqlQuery query, String paramName, Object inputValue, boolean ingoreError, Class<?>... inputTypes) voidsetResult(SqlRuntimeContext runtimeCtx, Object resultInstance, String attributeName, Object resultValue, boolean ingoreError) Initializes the attribute of the result class with output value from the SQL query execution.default voidsetResultEntryLog(org.slf4j.Logger logger, SqlMetaType sqlMetaType, SqlRuntimeContext runtimeCtx, Object resultInstance, String attributeName, Object resultValue, boolean ingoreError)
-
Method Details
-
getProviderSqlType
Object getProviderSqlType()Returns the type provided by the stack on top of which the SQL Processor works.- Returns:
- the provided type
-
addScalar
void addScalar(SqlTypeFactory typeFactory, SqlQuery query, String dbName, Class<?>... attributeTypes) Declares a scalar query result, which is an SQL query execution output value.- Parameters:
typeFactory- the SQL Type factoryquery- the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staffdbName- the name of a database query output, it can be the column name or the alias nameattributeTypes- the Java types of of the attribute in the result class
-
addScalarEntryLog
default void addScalarEntryLog(org.slf4j.Logger logger, SqlMetaType sqlMetaType, SqlTypeFactory typeFactory, SqlQuery query, String dbName, Class<?>... attributeTypes) -
setResult
void setResult(SqlRuntimeContext runtimeCtx, Object resultInstance, String attributeName, Object resultValue, boolean ingoreError) throws SqlRuntimeException Initializes the attribute of the result class with output value from the SQL query execution.- Parameters:
runtimeCtx- the runtimeCtx contextresultInstance- the instance of the result classattributeName- the name of the attribute in the result classresultValue- the query execution output valueingoreError- ignore improper output value handling- Throws:
SqlRuntimeException- in the case of any problem with the output values handling
-
getResult
default Object getResult(SqlRuntimeContext runtimeCtx, String attributeName, Object resultValue, boolean ingoreError) throws SqlRuntimeException Returns the attribute's result value (with possible conversion).- Parameters:
runtimeCtx- the runtimeCtx contextattributeName- the name of the attribute in the result classresultValue- the query execution output valueingoreError- ignore improper output value handling- Throws:
SqlRuntimeException- in the case of any problem with the output values handling
-
setResultEntryLog
default void setResultEntryLog(org.slf4j.Logger logger, SqlMetaType sqlMetaType, SqlRuntimeContext runtimeCtx, Object resultInstance, String attributeName, Object resultValue, boolean ingoreError) -
setParameter
void setParameter(SqlRuntimeContext runtimeCtx, SqlQuery query, String paramName, Object inputValue, boolean ingoreError, Class<?>... inputTypes) throws SqlRuntimeException Binds an input value to a named query parameter.- Parameters:
runtimeCtx- the runtimeCtx contextquery- the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staffparamName- the name of the parameteringoreError- ignore improper input value handlinginputTypes- the Java types of the attribute in the input POJO- Throws:
SqlRuntimeException- in the case of any problem with the input values handling
-
setParameterEntryLog
default void setParameterEntryLog(org.slf4j.Logger logger, SqlMetaType sqlMetaType, SqlRuntimeContext runtimeCtx, SqlQuery query, String paramName, Object inputValue, boolean ingoreError, Class<?>... inputTypes) -
error
Log or throw error.- Parameters:
logger- the internal slf4j loggeringoreError- ignore improper input value handlingmsg- the error message
-