Package org.sqlproc.engine.type
Class SqlDefaultType
java.lang.Object
org.sqlproc.engine.type.SqlDefaultType
- All Implemented Interfaces:
SqlMetaType,SqlTaggedMetaType
- Direct Known Subclasses:
JdbcDefaultType,SqlBigDecimalType,SqlBigIntegerType,SqlBlobType,SqlBooleanType,SqlByteArrayType,SqlByteType,SqlCharType,SqlClobType,SqlDateTimeType,SqlDateType,SqlDoubleType,SqlEnumIntegerType,SqlEnumStringType,SqlFloatType,SqlFromDateType,SqlInstantType,SqlIntegerType,SqlLocalDateTimeType,SqlLocalDateType,SqlLocalTimeType,SqlLongType,SqlOutValueType,SqlShortType,SqlStringType,SqlTextType,SqlTimestampType,SqlTimeType,SqlToDateType
The default META type for the JDBC stack. It's used in the case there's no explicit META type declaration in the META
SQL statements.
- Author:
- Vladimir Hudec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.LoggerThe internal slf4j logger. -
Constructor Summary
Constructors -
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.Class<?>[]Returns the list of Java class types related to this META type for SqlDefaultType processing.voidsetParameter(SqlRuntimeContext runtimeCtx, SqlQuery query, String paramName, Object inputValue, boolean ingoreError, Class<?>... inputTypes) Binds an input value to a named query parameter.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sqlproc.engine.type.SqlMetaType
addScalarEntryLog, error, getProviderSqlType, getResult, setParameterEntryLog, setResultEntryLogMethods inherited from interface org.sqlproc.engine.type.SqlTaggedMetaType
getClassTypes, getMetaTypes
-
Field Details
-
logger
protected final org.slf4j.Logger loggerThe internal slf4j logger.
-
-
Constructor Details
-
SqlDefaultType
public SqlDefaultType()
-
-
Method Details
-
getClassTypesForDefault
Returns the list of Java class types related to this META type for SqlDefaultType processing.- Returns:
- the list of Java class types related to this META type for SqlDefaultType processing
-
addScalar
public void addScalar(SqlTypeFactory typeFactory, SqlQuery query, String dbName, Class<?>... attributeTypes) Declares a scalar query result, which is an SQL query execution output value.- Specified by:
addScalarin interfaceSqlMetaType- 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
-
setResult
public 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.- Specified by:
setResultin interfaceSqlMetaType- 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
-
setParameter
public 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.- Specified by:
setParameterin interfaceSqlMetaType- 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
-