org.sqlproc.engine.impl
Enum SqlMetaType

java.lang.Object
  extended by java.lang.Enum<SqlMetaType>
      extended by org.sqlproc.engine.impl.SqlMetaType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SqlMetaType>

 enum SqlMetaType
extends java.lang.Enum<SqlMetaType>

The enumeration of all SQL META Types, which is the internal type. This type is used for the special processing of the input/output value.

Author:
Vladimir Hudec

Enum Constant Summary
BIG_DECIMAL
          BIGDEC and BIGDECIMAL are related to Hibernate.BIG_DECIMAL and BigDecimal.class.
BIG_INTEGER
          BIGINT and BIGINTEGER are related to Hibernate.BIG_INTEGER and BigInteger.class.
BOOLEAN
          BOOLEAN and BOOL are related to Hibernate.BOOLEAN, Boolean.class and boolean.class.
BYTE
          BYTE is related to BYTE, Byte and byte.class.
BYTE_ARRAY
          BYTEARR and BYTEARRAY are related to Hibernate.BINARY, Byte[].class and byte[].class.
CHAR
          CHARACTER and CHAR are related to Hibernate.CHARACTER, Character.class and char.class.
DATE
          DATE is related to Hibernate.DATE and java.util.Date.class.
DATETIME
          DATETIME is related to Hibernate.TIMESTAMP and java.util.Date.class.
DOUBLE
          DOUBLE is related to Hibernate.DOUBLE, Double.class and double.class.
ENUM_INT
          EINTEGER and EINT are related to Hibernate.INTEGER.
ENUM_STRING
          ENUMSTRING and ESTRING are related to Hibernate.STRING.
FLOAT
          FLOAT is related to Hibernate.FLOAT, Float.class and float.class.
FROMDATE
          FROMDATE is related to Hibernate.DATE and java.util.Date.class.
HIBERNATE
          It represents the Hibernate type.
INT
          INT and INTEGER are related to Hibernate.INTEGER, Integer.class and int.class.
LONG
          LONG is related to Hibernate.LONG, Long.class and long.class.
SHORT
          SHORT is related to Hibernate.SHORT, Short.class and short.class.
STRING
          STRING and STR are related to Hibernate.STRING and String.class.
TIME
          TIME is related to Hibernate.TIME and java.util.Date.class.
TIMESTAMP
          TIMESTAMP and STAMP are related to Hibernate.TIMESTAMP and java.sql.Timestamp.class.
TODATE
          TODATE is related to Hibernate.DATE and java.util.Date.class.
UNKNOWN
          It represents the type derived from Java attribute class.
 
Field Summary
(package private) static java.util.Map<java.lang.Class<?>,SqlMetaType> classToTypeMap
          The map between a Java class types and an internal types.
private  java.lang.Class<?>[] classTypes
          The list of Java class type;
private  org.hibernate.type.Type hibernateType
          The Hibernate type.
protected  org.slf4j.Logger logger
          The internal type, which means special processing of the input/output value.
(package private) static java.util.Map<java.lang.String,SqlMetaType> metaToTypeMap
          The map between a String representation of an internal types and an internal types.
private  java.lang.String[] metaTypes
          The list of String representation of the internal types, which means special processing of the input/output value.
 
Method Summary
(package private)  org.hibernate.type.Type getHibernateType()
          Returns the Hibernate type.
(package private) abstract  void setParameter(org.hibernate.Query query, java.lang.String paramName, java.lang.Object inputValue, org.hibernate.type.Type hibernateType)
          Bind an input value to a named query parameter.
(package private) abstract  void setResult(java.lang.Object resultInstance, java.lang.String attributeName, java.lang.Object resultValue, org.hibernate.type.Type hibernateType)
          Initializes the attribute of the result class with output values from SQL query execution.
static SqlMetaType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SqlMetaType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INT

public static final SqlMetaType INT
INT and INTEGER are related to Hibernate.INTEGER, Integer.class and int.class.


LONG

public static final SqlMetaType LONG
LONG is related to Hibernate.LONG, Long.class and long.class.


BYTE

public static final SqlMetaType BYTE
BYTE is related to BYTE, Byte and byte.class.


BYTE_ARRAY

public static final SqlMetaType BYTE_ARRAY
BYTEARR and BYTEARRAY are related to Hibernate.BINARY, Byte[].class and byte[].class.


SHORT

public static final SqlMetaType SHORT
SHORT is related to Hibernate.SHORT, Short.class and short.class.


STRING

public static final SqlMetaType STRING
STRING and STR are related to Hibernate.STRING and String.class.


CHAR

public static final SqlMetaType CHAR
CHARACTER and CHAR are related to Hibernate.CHARACTER, Character.class and char.class.


DATE

public static final SqlMetaType DATE
DATE is related to Hibernate.DATE and java.util.Date.class.


FROMDATE

public static final SqlMetaType FROMDATE
FROMDATE is related to Hibernate.DATE and java.util.Date.class.


TODATE

public static final SqlMetaType TODATE
TODATE is related to Hibernate.DATE and java.util.Date.class.


TIME

public static final SqlMetaType TIME
TIME is related to Hibernate.TIME and java.util.Date.class.


DATETIME

public static final SqlMetaType DATETIME
DATETIME is related to Hibernate.TIMESTAMP and java.util.Date.class.


TIMESTAMP

public static final SqlMetaType TIMESTAMP
TIMESTAMP and STAMP are related to Hibernate.TIMESTAMP and java.sql.Timestamp.class.


BOOLEAN

public static final SqlMetaType BOOLEAN
BOOLEAN and BOOL are related to Hibernate.BOOLEAN, Boolean.class and boolean.class.


FLOAT

public static final SqlMetaType FLOAT
FLOAT is related to Hibernate.FLOAT, Float.class and float.class.


DOUBLE

public static final SqlMetaType DOUBLE
DOUBLE is related to Hibernate.DOUBLE, Double.class and double.class.


BIG_INTEGER

public static final SqlMetaType BIG_INTEGER
BIGINT and BIGINTEGER are related to Hibernate.BIG_INTEGER and BigInteger.class.


BIG_DECIMAL

public static final SqlMetaType BIG_DECIMAL
BIGDEC and BIGDECIMAL are related to Hibernate.BIG_DECIMAL and BigDecimal.class.


ENUM_STRING

public static final SqlMetaType ENUM_STRING
ENUMSTRING and ESTRING are related to Hibernate.STRING.


ENUM_INT

public static final SqlMetaType ENUM_INT
EINTEGER and EINT are related to Hibernate.INTEGER.


HIBERNATE

public static final SqlMetaType HIBERNATE
It represents the Hibernate type.


UNKNOWN

public static final SqlMetaType UNKNOWN
It represents the type derived from Java attribute class.

Field Detail

logger

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


hibernateType

private org.hibernate.type.Type hibernateType
The Hibernate type. A standard way to assing the type of parameter/scalar binding to the Hibernate Query.


classTypes

private java.lang.Class<?>[] classTypes
The list of Java class type;


metaTypes

private java.lang.String[] metaTypes
The list of String representation of the internal types, which means special processing of the input/output value.


classToTypeMap

static java.util.Map<java.lang.Class<?>,SqlMetaType> classToTypeMap
The map between a Java class types and an internal types.


metaToTypeMap

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

Method Detail

values

public static SqlMetaType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SqlMetaType c : SqlMetaType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SqlMetaType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getHibernateType

org.hibernate.type.Type getHibernateType()
Returns the Hibernate type. A standard way to assing the type of parameter/scalar binding to the Hibernate Query.

Returns:
the Hibernate type

setResult

abstract void setResult(java.lang.Object resultInstance,
                        java.lang.String attributeName,
                        java.lang.Object resultValue,
                        org.hibernate.type.Type hibernateType)
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
hibernateType - the Hibernate type

setParameter

abstract void setParameter(org.hibernate.Query query,
                           java.lang.String paramName,
                           java.lang.Object inputValue,
                           org.hibernate.type.Type hibernateType)
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
type - the Hibernate type


Copyright © 2010. All Rights Reserved.