Package org.sqlproc.engine.jdbc.type
Class JdbcTypeFactory
java.lang.Object
org.sqlproc.engine.jdbc.type.JdbcTypeFactory
- All Implemented Interfaces:
SqlTypeFactory
The factory definition for the JDBC stack, which can be used to construct the
The implementation is based on the Singleton design pattern.
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
FieldsModifier and TypeFieldDescription(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BIG_DECIMAL.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BIG_INTEGER.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BLOB.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BOOLEAN.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BYTE.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BYTE_ARRAY.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type BYTE_ARRAY_WRAPPER.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type CHAR.(package private) static Map<Class<?>, SqlMetaType> The immutable map between the Java class types and the internal types.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type CLOB.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type DATE.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type DATE_TIME.(package private) static final SqlMetaTypeSingleton instance of default type.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type DOUBLE.(package private) static final SqlMetaTypeSingleton instance of Integer based enumeration type ENUM_INT.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type ENUM_STRING.private static JdbcTypeFactoryThe private static instance of this factory.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type FLOAT.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type FROM_DATE.(package private) static final SqlMetaTypeSingleton instance of auto-generated identity type IDENTITY.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type INSTANT.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type INTEGER.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type LOCAL_DATE.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type LOCAL_DATE_TIME.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type LOCAL_TIME.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type LONG.(package private) static Map<String, SqlMetaType> The immutable map between the META types name and the internal types.(package private) static final SqlMetaTypeSingleton instance of auto-generated identity type ORACLE_CURSOR.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type OTHER.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type SHORT.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type STRING.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type TEXT.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type TIME.(package private) static final SqlMetaTypeSingleton instance of String based enumeration typeTIMESTAMP.(package private) static final SqlMetaTypeSingleton instance of String based enumeration type TO_DATE.(package private) static final SqlMetaType[]Singleton instances of generic types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the collection of all the META types provided by this factory.Returns the default META type.Returns the META type for the enumerations based on Integer internal type.Returns the META type for the enumerations based on String internal type.Returns the META type for an auto-generated identity.static JdbcTypeFactoryThe main method to obtain the singleton instance of this factory.getMetaType(Class<?> clazz) Returns the META type, which can be used to handle input/output values of provided Java type.getMetaType(String name) Returns the META type with the provided name.
-
Field Details
-
factory
The private static instance of this factory. -
ENUM_INT
Singleton instance of Integer based enumeration type ENUM_INT. -
ENUM_STRING
Singleton instance of String based enumeration type ENUM_STRING. -
BIG_DECIMAL
Singleton instance of String based enumeration type BIG_DECIMAL. -
BIG_INTEGER
Singleton instance of String based enumeration type BIG_INTEGER. -
BOOLEAN
Singleton instance of String based enumeration type BOOLEAN. -
BYTE_ARRAY
Singleton instance of String based enumeration type BYTE_ARRAY. -
BYTE_ARRAY_WRAPPER
Singleton instance of String based enumeration type BYTE_ARRAY_WRAPPER. -
BYTE
Singleton instance of String based enumeration type BYTE. -
CHAR
Singleton instance of String based enumeration type CHAR. -
DATE_TIME
Singleton instance of String based enumeration type DATE_TIME. -
DATE
Singleton instance of String based enumeration type DATE. -
DOUBLE
Singleton instance of String based enumeration type DOUBLE. -
FLOAT
Singleton instance of String based enumeration type FLOAT. -
FROM_DATE
Singleton instance of String based enumeration type FROM_DATE. -
INTEGER
Singleton instance of String based enumeration type INTEGER. -
LOCAL_DATE
Singleton instance of String based enumeration type LOCAL_DATE. -
LOCAL_DATE_TIME
Singleton instance of String based enumeration type LOCAL_DATE_TIME. -
LOCAL_TIME
Singleton instance of String based enumeration type LOCAL_TIME. -
INSTANT
Singleton instance of String based enumeration type INSTANT. -
LONG
Singleton instance of String based enumeration type LONG. -
SHORT
Singleton instance of String based enumeration type SHORT. -
TEXT
Singleton instance of String based enumeration type TEXT. -
STRING
Singleton instance of String based enumeration type STRING. -
TIMESTAMP
Singleton instance of String based enumeration typeTIMESTAMP. -
TIME
Singleton instance of String based enumeration type TIME. -
TO_DATE
Singleton instance of String based enumeration type TO_DATE. -
BLOB
Singleton instance of String based enumeration type BLOB. -
CLOB
Singleton instance of String based enumeration type CLOB. -
OTHER
Singleton instance of String based enumeration type OTHER. -
ORACLE_CURSOR
Singleton instance of auto-generated identity type ORACLE_CURSOR. -
IDENTITY
Singleton instance of auto-generated identity type IDENTITY. -
DEFAULT
Singleton instance of default type. -
TYPES
Singleton instances of generic types. -
CLASS_TO_TYPE_MAP
The immutable map between the Java class types and the internal types. -
META_TO_TYPE_MAP
The immutable map between the META types name and the internal types.
-
-
Constructor Details
-
JdbcTypeFactory
private JdbcTypeFactory()The private constructor.
-
-
Method Details
-
getInstance
The main method to obtain the singleton instance of this factory.- Returns:
- the META types factory for the JDBC stack
-
getDefaultType
Returns the default META type. It's used in the case there's no explicit META type declaration in the META SQL statements.- Specified by:
getDefaultTypein interfaceSqlTypeFactory- Returns:
- the default META type
-
getEnumIntegerType
Returns the META type for the enumerations based on Integer internal type.- Specified by:
getEnumIntegerTypein interfaceSqlTypeFactory- Returns:
- the META type for the enumerations based on Integer internal type
-
getEnumStringType
Returns the META type for the enumerations based on String internal type.- Specified by:
getEnumStringTypein interfaceSqlTypeFactory- Returns:
- the META type for the enumerations based on String internal type
-
getIdentityType
Returns the META type for an auto-generated identity.- Specified by:
getIdentityTypein interfaceSqlTypeFactory- Returns:
- the META type for an auto-generated identity
-
getAllTypes
Returns the collection of all the META types provided by this factory.- Specified by:
getAllTypesin interfaceSqlTypeFactory- Returns:
- the collection of all the META types
-
getMetaType
Returns the META type, which can be used to handle input/output values of provided Java type.- Specified by:
getMetaTypein interfaceSqlTypeFactory- Parameters:
clazz- the input/output value Java type- Returns:
- the META type
-
getMetaType
Returns the META type with the provided name.- Specified by:
getMetaTypein interfaceSqlTypeFactory- Parameters:
name- the name of the META SQL type- Returns:
- the META type
-