org.sqlproc.engine.impl.type
Class SqlMetaType

java.lang.Object
  extended by org.sqlproc.engine.impl.type.SqlMetaType
Direct Known Subclasses:
SqlDefaultType, SqlGenericType

public abstract class SqlMetaType
extends java.lang.Object

The common ancestor of all SQL META Types. These internal types are devoted for the special processing of the input/output values.

Author:
Vladimir Hudec

Field Summary
static java.util.Map<java.lang.Class<?>,SqlMetaType> CLASS_TO_TYPE_MAP
          The immutable map between a Java class type and an internal type.
static SqlMetaType DEFAULT
          Singleton instance of default type.
static SqlMetaType ENUM_INT
          Singleton instance of Integer based enumeration type.
static SqlMetaType ENUM_STRING
          Singleton instance of String based enumeration type.
protected  org.slf4j.Logger logger
          The internal type, which means special processing of the input/output value.
static java.util.Map<java.lang.String,SqlMetaType> META_TO_TYPE_MAP
          The immutable map between a String representation of an internal types and an internal types.
static SqlMetaType[] TYPES
          Singleton instances of generic types.
 
Constructor Summary
SqlMetaType()
           
 
Method Summary
abstract  void setParameter(org.hibernate.Query query, java.lang.String paramName, java.lang.Object inputValue, java.lang.Class<?> inputType, boolean ingoreError)
          Bind an input value to a named query parameter.
abstract  void setResult(java.lang.Object resultInstance, java.lang.String attributeName, java.lang.Object resultValue, boolean ingoreError)
          Initializes the attribute of the result class with output values from SQL query execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

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


DEFAULT

public static final SqlMetaType DEFAULT
Singleton instance of default type.


ENUM_INT

public static final SqlMetaType ENUM_INT
Singleton instance of Integer based enumeration type.


ENUM_STRING

public static final SqlMetaType ENUM_STRING
Singleton instance of String based enumeration type.


TYPES

public static final SqlMetaType[] TYPES
Singleton instances of generic types.


CLASS_TO_TYPE_MAP

public static java.util.Map<java.lang.Class<?>,SqlMetaType> CLASS_TO_TYPE_MAP
The immutable map between a Java class type and an internal type.


META_TO_TYPE_MAP

public static java.util.Map<java.lang.String,SqlMetaType> META_TO_TYPE_MAP
The immutable map between a String representation of an internal types and an internal types.

Constructor Detail

SqlMetaType

public SqlMetaType()
Method Detail

setResult

public abstract void setResult(java.lang.Object resultInstance,
                               java.lang.String attributeName,
                               java.lang.Object resultValue,
                               boolean ingoreError)
                        throws SqlRuntimeException
Initializes the attribute of the result class with output values from SQL query execution.

Parameters:
resultInstance - the instance of the result class
attributeName - the name of the attribute in the result class
resultValue - Query execution output value
ingoreError - ignore inproper output value handling
Throws:
SqlRuntimeException - in the case of any problem with output values handling

setParameter

public abstract void setParameter(org.hibernate.Query query,
                                  java.lang.String paramName,
                                  java.lang.Object inputValue,
                                  java.lang.Class<?> inputType,
                                  boolean ingoreError)
                           throws SqlRuntimeException
Bind an input value to a named query parameter.

Parameters:
query - the object-oriented representation of a Hibernate query
paramName - the name of the parameter
inputValue - the possibly-null parameter value, a dynamic input value
ingoreError - ignore inproper input value handling
Throws:
SqlRuntimeException - in the case of any problem with input values handling


Copyright © 2011. All Rights Reserved.