Class HibernateTypeFactory
- java.lang.Object
-
- 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 theSqlMetaTypeinstances. 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
Fields Modifier and Type Field Description (package private) static SqlMetaTypeBIG_DECIMALSingleton instance of String based enumeration type.(package private) static SqlMetaTypeBIG_INTEGERSingleton instance of String based enumeration type.(package private) static SqlMetaTypeBLOBSingleton instance of String based enumeration type.(package private) static SqlMetaTypeBOOLEANSingleton instance of String based enumeration type.(package private) static SqlMetaTypeBYTESingleton instance of String based enumeration type.(package private) static SqlMetaTypeBYTE_ARRAYSingleton instance of String based enumeration type.(package private) static SqlMetaTypeBYTE_ARRAY_WRAPPERSingleton instance of String based enumeration type.(package private) static SqlMetaTypeCHARSingleton instance of String based enumeration type.(package private) static Map<Class<?>,SqlMetaType>CLASS_TO_TYPE_MAPThe immutable map between the Java class types and the internal types.(package private) static SqlMetaTypeCLOBSingleton instance of String based enumeration type.(package private) static SqlMetaTypeDATESingleton instance of String based enumeration type.(package private) static SqlMetaTypeDATE_TIMESingleton instance of String based enumeration type.(package private) static SqlMetaTypeDEFAULTSingleton instance of default type.(package private) static SqlMetaTypeDOUBLESingleton instance of String based enumeration type.(package private) static SqlMetaTypeENUM_INTSingleton instance of Integer based enumeration type.(package private) static SqlMetaTypeENUM_STRINGSingleton instance of String based enumeration type.private static HibernateTypeFactoryfactoryThe private static instance of this factory.(package private) static SqlMetaTypeFLOATSingleton instance of String based enumeration type.(package private) static SqlMetaTypeFROM_DATESingleton instance of String based enumeration type.(package private) static SqlMetaTypeIDENTITYSingleton instance of auto-generated identity type.(package private) static SqlMetaTypeINSTANTSingleton instance of String based enumeration type.(package private) static SqlMetaTypeINTEGERSingleton instance of String based enumeration type.(package private) static SqlMetaTypeLOCAL_DATESingleton instance of String based enumeration type.(package private) static SqlMetaTypeLOCAL_DATE_TIMESingleton instance of String based enumeration type.(package private) static SqlMetaTypeLOCAL_TIMESingleton instance of String based enumeration type.(package private) static SqlMetaTypeLONGSingleton instance of String based enumeration type.(package private) static Map<String,SqlMetaType>META_TO_TYPE_MAPThe immutable map between the META types name and the internal types.(package private) static SqlMetaTypeSHORTSingleton instance of String based enumeration type.(package private) static SqlMetaTypeSTRINGSingleton instance of String based enumeration type.(package private) static SqlMetaTypeTEXTSingleton instance of String based enumeration type.(package private) static SqlMetaTypeTIMESingleton instance of String based enumeration type.(package private) static SqlMetaTypeTIMESTAMPSingleton instance of String based enumeration type.(package private) static SqlMetaTypeTO_DATESingleton instance of String based enumeration type.(package private) static SqlMetaType[]TYPESSingleton instances of generic types.
-
Constructor Summary
Constructors Modifier Constructor Description privateHibernateTypeFactory()The private constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlMetaType[]getAllTypes()SqlMetaTypegetDefaultType()SqlMetaTypegetEnumIntegerType()SqlMetaTypegetEnumStringType()SqlMetaTypegetIdentityType()static HibernateTypeFactorygetInstance()The main method to obtain the singleton instance of this factory.SqlMetaTypegetMetaType(Class<?> clazz)SqlMetaTypegetMetaType(String name)
-
-
-
Field Detail
-
factory
private static HibernateTypeFactory factory
The private static instance of this factory.
-
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.
-
BIG_DECIMAL
static final SqlMetaType BIG_DECIMAL
Singleton instance of String based enumeration type.
-
BIG_INTEGER
static final SqlMetaType BIG_INTEGER
Singleton instance of String based enumeration type.
-
BOOLEAN
static final SqlMetaType BOOLEAN
Singleton instance of String based enumeration type.
-
BYTE_ARRAY
static final SqlMetaType BYTE_ARRAY
Singleton instance of String based enumeration type.
-
BYTE_ARRAY_WRAPPER
static final SqlMetaType BYTE_ARRAY_WRAPPER
Singleton instance of String based enumeration type.
-
BYTE
static final SqlMetaType BYTE
Singleton instance of String based enumeration type.
-
CHAR
static final SqlMetaType CHAR
Singleton instance of String based enumeration type.
-
DATE_TIME
static final SqlMetaType DATE_TIME
Singleton instance of String based enumeration type.
-
DATE
static final SqlMetaType DATE
Singleton instance of String based enumeration type.
-
DOUBLE
static final SqlMetaType DOUBLE
Singleton instance of String based enumeration type.
-
FLOAT
static final SqlMetaType FLOAT
Singleton instance of String based enumeration type.
-
FROM_DATE
static final SqlMetaType FROM_DATE
Singleton instance of String based enumeration type.
-
INTEGER
static final SqlMetaType INTEGER
Singleton instance of String based enumeration type.
-
LOCAL_DATE
static final SqlMetaType LOCAL_DATE
Singleton instance of String based enumeration type.
-
LOCAL_DATE_TIME
static final SqlMetaType LOCAL_DATE_TIME
Singleton instance of String based enumeration type.
-
LOCAL_TIME
static final SqlMetaType LOCAL_TIME
Singleton instance of String based enumeration type.
-
INSTANT
static final SqlMetaType INSTANT
Singleton instance of String based enumeration type.
-
LONG
static final SqlMetaType LONG
Singleton instance of String based enumeration type.
-
SHORT
static final SqlMetaType SHORT
Singleton instance of String based enumeration type.
-
TEXT
static final SqlMetaType TEXT
Singleton instance of String based enumeration type.
-
STRING
static final SqlMetaType STRING
Singleton instance of String based enumeration type.
-
TIMESTAMP
static final SqlMetaType TIMESTAMP
Singleton instance of String based enumeration type.
-
TIME
static final SqlMetaType TIME
Singleton instance of String based enumeration type.
-
TO_DATE
static final SqlMetaType TO_DATE
Singleton instance of String based enumeration type.
-
BLOB
static final SqlMetaType BLOB
Singleton instance of String based enumeration type.
-
CLOB
static final SqlMetaType CLOB
Singleton instance of String based enumeration type.
-
IDENTITY
static final SqlMetaType IDENTITY
Singleton instance of auto-generated identity type.
-
DEFAULT
static final SqlMetaType DEFAULT
Singleton instance of default 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.
-
-
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:
getDefaultTypein interfaceSqlTypeFactory
-
getEnumIntegerType
public SqlMetaType getEnumIntegerType()
- Specified by:
getEnumIntegerTypein interfaceSqlTypeFactory
-
getEnumStringType
public SqlMetaType getEnumStringType()
- Specified by:
getEnumStringTypein interfaceSqlTypeFactory
-
getIdentityType
public SqlMetaType getIdentityType()
- Specified by:
getIdentityTypein interfaceSqlTypeFactory
-
getAllTypes
public SqlMetaType[] getAllTypes()
- Specified by:
getAllTypesin interfaceSqlTypeFactory
-
getMetaType
public SqlMetaType getMetaType(Class<?> clazz)
- Specified by:
getMetaTypein interfaceSqlTypeFactory
-
getMetaType
public SqlMetaType getMetaType(String name)
- Specified by:
getMetaTypein interfaceSqlTypeFactory
-
-