org.sqlproc.engine.hibernate.type
Class HibernateTypeFactory

java.lang.Object
  extended by org.sqlproc.engine.hibernate.type.HibernateTypeFactory
All Implemented Interfaces:
SqlTypeFactory

public class HibernateTypeFactory
extends Object
implements SqlTypeFactory

The factory definition for the Hibernate stack, which can be used to construct the SqlMetaType instances. In the process of the META SQL statements and mapping rules parsing the input/output values META types have to be established. For this purpose a factory class responsible for these META types construction has to be supplied.
The implementation is based on the Singleton design pattern.

Author:
Vladimir Hudec

Field Summary
(package private) static Map<Class<?>,SqlMetaType> CLASS_TO_TYPE_MAP
          The immutable map between the Java class types and the internal types.
(package private) static SqlMetaType DEFAULT
          Singleton instance of default type.
(package private) static SqlMetaType ENUM_INT
          Singleton instance of Integer based enumeration type.
(package private) static SqlMetaType ENUM_STRING
          Singleton instance of String based enumeration type.
private static HibernateTypeFactory factory
          The private static instance of this factory.
(package private) static SqlMetaType IDENTITY
          Singleton instance of String based enumeration type.
(package private) static Map<String,SqlMetaType> META_TO_TYPE_MAP
          The immutable map between the META types name and the internal types.
(package private) static SqlMetaType[] TYPES
          Singleton instances of generic types.
 
Constructor Summary
private HibernateTypeFactory()
          The private constructor.
 
Method Summary
 SqlMetaType[] getAllTypes()
          
 SqlMetaType getDefaultType()
          
 SqlMetaType getEnumIntegerType()
          
 SqlMetaType getEnumStringType()
          
 SqlMetaType getIdentityType()
          
static HibernateTypeFactory getInstance()
          The main method to obtain the singleton instance of this factory.
 SqlMetaType getMetaType(Class<?> clazz)
          
 SqlMetaType getMetaType(String name)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

private static HibernateTypeFactory factory
The private static instance of this factory.


DEFAULT

static final SqlMetaType DEFAULT
Singleton instance of default type.


ENUM_INT

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


ENUM_STRING

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


IDENTITY

static final SqlMetaType IDENTITY
Singleton instance of String based enumeration type.


TYPES

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


CLASS_TO_TYPE_MAP

static Map<Class<?>,SqlMetaType> CLASS_TO_TYPE_MAP
The immutable map between the Java class types and the internal types.


META_TO_TYPE_MAP

static Map<String,SqlMetaType> META_TO_TYPE_MAP
The immutable map between the META types name and the internal types.

Constructor Detail

HibernateTypeFactory

private HibernateTypeFactory()
The private constructor.

Method Detail

getInstance

public static HibernateTypeFactory getInstance()
The main method to obtain the singleton instance of this factory.

Returns:
the META types factory for the Hibernate stack

getDefaultType

public SqlMetaType getDefaultType()

Specified by:
getDefaultType in interface SqlTypeFactory

getEnumIntegerType

public SqlMetaType getEnumIntegerType()

Specified by:
getEnumIntegerType in interface SqlTypeFactory

getEnumStringType

public SqlMetaType getEnumStringType()

Specified by:
getEnumStringType in interface SqlTypeFactory

getIdentityType

public SqlMetaType getIdentityType()

Specified by:
getIdentityType in interface SqlTypeFactory

getAllTypes

public SqlMetaType[] getAllTypes()

Specified by:
getAllTypes in interface SqlTypeFactory

getMetaType

public SqlMetaType getMetaType(Class<?> clazz)

Specified by:
getMetaType in interface SqlTypeFactory

getMetaType

public SqlMetaType getMetaType(String name)

Specified by:
getMetaType in interface SqlTypeFactory


Copyright © 2013. All Rights Reserved.