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

public abstract class SqlDefaultType extends Object implements SqlTaggedMetaType
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 Details

    • logger

      protected final org.slf4j.Logger logger
      The internal slf4j logger.
  • Constructor Details

    • SqlDefaultType

      public SqlDefaultType()
  • Method Details

    • getClassTypesForDefault

      public Class<?>[] 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:
      addScalar in interface SqlMetaType
      Parameters:
      typeFactory - the SQL Type factory
      query - the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staff
      dbName - the name of a database query output, it can be the column name or the alias name
      attributeTypes - 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:
      setResult in interface SqlMetaType
      Parameters:
      runtimeCtx - the runtimeCtx context
      resultInstance - the instance of the result class
      attributeName - the name of the attribute in the result class
      resultValue - the query execution output value
      ingoreError - 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:
      setParameter in interface SqlMetaType
      Parameters:
      runtimeCtx - the runtimeCtx context
      query - the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staff
      paramName - the name of the parameter
      ingoreError - ignore improper input value handling
      inputTypes - the Java types of the attribute in the input POJO
      Throws:
      SqlRuntimeException - in the case of any problem with the input values handling