org.sqlproc.engine.jdbc.type
Class JdbcDefaultType

java.lang.Object
  extended by org.sqlproc.engine.type.SqlMetaType
      extended by org.sqlproc.engine.jdbc.type.JdbcDefaultType

public class JdbcDefaultType
extends SqlMetaType

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
(package private) static Map<Class<?>,Object> jdbcTypes
          The map between the Java types and the META types.
 
Fields inherited from class org.sqlproc.engine.type.SqlMetaType
logger
 
Constructor Summary
JdbcDefaultType()
           
 
Method Summary
 void addScalar(SqlQuery query, String dbName, Class<?> attributeType)
          Declares a scalar query result, which is an SQL query execution output value.
 void setParameter(SqlRuntimeContext runtimeCtx, SqlQuery query, String paramName, Object inputValue, Class<?> inputType, boolean ingoreError)
          Binds an input value to a named query parameter.
 void setResult(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, wait
 

Field Detail

jdbcTypes

static Map<Class<?>,Object> jdbcTypes
The map between the Java types and the META types.

Constructor Detail

JdbcDefaultType

public JdbcDefaultType()
Method Detail

addScalar

public void addScalar(SqlQuery query,
                      String dbName,
                      Class<?> attributeType)
Declares a scalar query result, which is an SQL query execution output value.

Specified by:
addScalar in class SqlMetaType
Parameters:
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
attributeType - the Java type 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 class SqlMetaType
Parameters:
runtimeCtx - the public 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,
                         Class<?> inputType,
                         boolean ingoreError)
                  throws SqlRuntimeException
Binds an input value to a named query parameter.

Specified by:
setParameter in class SqlMetaType
Parameters:
runtimeCtx - the public runtimeCtx context
query - the SQL Engine query, an adapter or proxy to the internal JDBC or ORM staff
paramName - the name of the parameter
inputValue - the possibly-null parameter value, a dynamic input value
ingoreError - ignore improper input value handling
Throws:
SqlRuntimeException - in the case of any problem with the input values handling


Copyright © 2015. All rights reserved.