org.sqlproc.engine.impl.type
Class SqlGenericType

java.lang.Object
  extended by org.sqlproc.engine.impl.type.SqlMetaType
      extended by org.sqlproc.engine.impl.type.SqlGenericType
Direct Known Subclasses:
SqlBigDecimalType, SqlBigIntegerType, SqlBooleanType, SqlByteArrayType, SqlByteType, SqlCharType, SqlDateTimeType, SqlDateType, SqlDoubleType, SqlEnumIntegerType, SqlEnumStringType, SqlFloatType, SqlFromDateType, SqlIntegerType, SqlLongType, SqlShortType, SqlStringType, SqlTimestampType, SqlTimeType, SqlToDateType

public abstract class SqlGenericType
extends SqlMetaType

The common ancestor of all generic SQL META Types. These internal types are based on standard processing of the input/output values.

Author:
Vladimir Hudec

Field Summary
 
Fields inherited from class org.sqlproc.engine.impl.type.SqlMetaType
CLASS_TO_TYPE_MAP, DEFAULT, ENUM_INT, ENUM_STRING, logger, META_TO_TYPE_MAP, TYPES
 
Constructor Summary
SqlGenericType()
           
 
Method Summary
abstract  java.lang.Class<?>[] getClassTypes()
          The list of Java class type;
abstract  org.hibernate.type.Type getHibernateType()
          The Hibernate type.
abstract  java.lang.String[] getMetaTypes()
          The list of String representation of the internal types, which means special processing of the input/output value.
 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.
 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
 

Constructor Detail

SqlGenericType

public SqlGenericType()
Method Detail

getHibernateType

public abstract org.hibernate.type.Type getHibernateType()
The Hibernate type. A standard way to assign the type of parameter/scalar binding to the Hibernate Query.


getClassTypes

public abstract java.lang.Class<?>[] getClassTypes()
The list of Java class type;


getMetaTypes

public abstract java.lang.String[] getMetaTypes()
The list of String representation of the internal types, which means special processing of the input/output value.


setResult

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

Specified by:
setResult in class SqlMetaType
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 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.

Specified by:
setParameter in class SqlMetaType
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.