Package org.sqlproc.engine.type
Class SqlComposedTypeFactory
java.lang.Object
org.sqlproc.engine.type.SqlComposedTypeFactory
- All Implemented Interfaces:
SqlTypeFactory
The factory definition, which can be used to construct the
SqlMetaType instances.
It's used to combine the factory of the underlying stack (on top of which the SQL Processor works) and the custom
META types provided in the time of SqlProcessorLoader construction.- Author:
- Vladimir Hudec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<Class<?>, SqlMetaType> The map between a Java class type and an internal type.private Map<String, SqlMetaType> The map between a String representation of an internal type and an internal type.private SqlTypeFactoryThe factory of the underlying stack. -
Constructor Summary
ConstructorsConstructorDescriptionSqlComposedTypeFactory(SqlTypeFactory typeFactory) Creates a new instance of this factory.SqlComposedTypeFactory(SqlTypeFactory typeFactory, List<SqlMetaType> customTypes) Creates a new instance of this factory. -
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.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
-
classToTypeMap
The map between a Java class type and an internal type. -
metaToTypeMap
The map between a String representation of an internal type and an internal type. -
typeFactory
The factory of the underlying stack.
-
-
Constructor Details
-
SqlComposedTypeFactory
Creates a new instance of this factory.- Parameters:
typeFactory- the factory of the underlying stack
-
SqlComposedTypeFactory
Creates a new instance of this factory.- Parameters:
typeFactory- the factory of the underlying stackcustomTypes- a collection of the custom META types provided by an user
-
-
Method Details
-
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
-