Class SqlComposedTypeFactory

java.lang.Object
org.sqlproc.engine.type.SqlComposedTypeFactory
All Implemented Interfaces:
SqlTypeFactory

public class SqlComposedTypeFactory extends Object implements 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 Details

    • classToTypeMap

      private Map<Class<?>,SqlMetaType> classToTypeMap
      The map between a Java class type and an internal type.
    • metaToTypeMap

      private Map<String,SqlMetaType> metaToTypeMap
      The map between a String representation of an internal type and an internal type.
    • typeFactory

      private SqlTypeFactory typeFactory
      The factory of the underlying stack.
  • Constructor Details

    • SqlComposedTypeFactory

      public SqlComposedTypeFactory(SqlTypeFactory typeFactory)
      Creates a new instance of this factory.
      Parameters:
      typeFactory - the factory of the underlying stack
    • SqlComposedTypeFactory

      public SqlComposedTypeFactory(SqlTypeFactory typeFactory, List<SqlMetaType> customTypes)
      Creates a new instance of this factory.
      Parameters:
      typeFactory - the factory of the underlying stack
      customTypes - a collection of the custom META types provided by an user
  • Method Details

    • getDefaultType

      public SqlMetaType 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:
      getDefaultType in interface SqlTypeFactory
      Returns:
      the default META type
    • getEnumIntegerType

      public SqlMetaType getEnumIntegerType()
      Returns the META type for the enumerations based on Integer internal type.
      Specified by:
      getEnumIntegerType in interface SqlTypeFactory
      Returns:
      the META type for the enumerations based on Integer internal type
    • getEnumStringType

      public SqlMetaType getEnumStringType()
      Returns the META type for the enumerations based on String internal type.
      Specified by:
      getEnumStringType in interface SqlTypeFactory
      Returns:
      the META type for the enumerations based on String internal type
    • getIdentityType

      public SqlMetaType getIdentityType()
      Returns the META type for an auto-generated identity.
      Specified by:
      getIdentityType in interface SqlTypeFactory
      Returns:
      the META type for an auto-generated identity
    • getAllTypes

      public SqlMetaType[] getAllTypes()
      Returns the collection of all the META types provided by this factory.
      Specified by:
      getAllTypes in interface SqlTypeFactory
      Returns:
      the collection of all the META types
    • getMetaType

      public SqlMetaType getMetaType(Class<?> clazz)
      Returns the META type, which can be used to handle input/output values of provided Java type.
      Specified by:
      getMetaType in interface SqlTypeFactory
      Parameters:
      clazz - the input/output value Java type
      Returns:
      the META type
    • getMetaType

      public SqlMetaType getMetaType(String name)
      Returns the META type with the provided name.
      Specified by:
      getMetaType in interface SqlTypeFactory
      Parameters:
      name - the name of the META SQL type
      Returns:
      the META type