org.sqlproc.engine.impl
Class SqlType

java.lang.Object
  extended by org.sqlproc.engine.impl.SqlType

 class SqlType
extends Object

The SQL type of a dynamic input value (SQL statement parameter) or an output value (SQL query scalar).

Author:
Vladimir Hudec

Field Summary
protected  org.slf4j.Logger logger
          The internal type, which means special processing of the input/output value.
private  SqlMetaType metaType
          The internal META type, which means special processing of the input/output value.
private  String value
          Right now only for the special of the enumeration type of the input value.
 
Constructor Summary
SqlType()
          Creates a new instance with unspecified internal type.
SqlType(SqlMetaType metaType)
          Creates a new instance with specified internal type.
 
Method Summary
(package private)  SqlMetaType getMetaType(SqlProcessContext ctx)
          Returns the internal type.
 String getValue()
          Returns the value.
(package private)  void setParameter(SqlProcessContext ctx, SqlQuery query, String paramName, Object inputValue, Class<?> inputType)
          Bind an input value to a named query parameter.
(package private)  void setResult(SqlProcessContext ctx, Object resultInstance, String attributeName, Object resultValue)
          Initializes the attribute of the result class with output values from SQL query execution.
 void setValue(String value)
          Sets the value.
 String toString()
          For debug purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
The internal type, which means special processing of the input/output value.


metaType

private SqlMetaType metaType
The internal META type, which means special processing of the input/output value.


value

private String 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 Detail

SqlType

SqlType()
Creates a new instance with unspecified internal type.


SqlType

SqlType(SqlMetaType metaType)
Creates a new instance with specified internal type.

Parameters:
metaType - the internal type
Method Detail

getMetaType

SqlMetaType getMetaType(SqlProcessContext ctx)
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 processing
resultInstance - the instance of the result class
attributeName - the name of the attribute in the result class
resultValue - 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<?> inputType)
            throws SqlRuntimeException
Bind an input value to a named query parameter.

Parameters:
ctx - the crate for all input parameters and the context of processing
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
Throws:
SqlRuntimeException - in the case of any problem with input values handling

getValue

public String 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

public void setValue(String value)
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

public String toString()
For debug purposes.

Overrides:
toString in class Object
Returns:
a String representation for a debug output


Copyright © 2015. All rights reserved.