Class JdbcTypeFactory

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

public class JdbcTypeFactory extends Object implements SqlTypeFactory
The factory definition for the JDBC 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

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BIG_DECIMAL.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BIG_INTEGER.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BLOB.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BOOLEAN.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BYTE.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BYTE_ARRAY.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type BYTE_ARRAY_WRAPPER.
    (package private) static final SqlMetaType
    Singleton 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 SqlMetaType
    Singleton instance of String based enumeration type CLOB.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type DATE.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type DATE_TIME.
    (package private) static final SqlMetaType
    Singleton instance of default type.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type DOUBLE.
    (package private) static final SqlMetaType
    Singleton instance of Integer based enumeration type ENUM_INT.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type ENUM_STRING.
    private static JdbcTypeFactory
    The private static instance of this factory.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type FLOAT.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type FROM_DATE.
    (package private) static final SqlMetaType
    Singleton instance of auto-generated identity type IDENTITY.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type INSTANT.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type INTEGER.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type LOCAL_DATE.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type LOCAL_DATE_TIME.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type LOCAL_TIME.
    (package private) static final SqlMetaType
    Singleton 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 SqlMetaType
    Singleton instance of auto-generated identity type ORACLE_CURSOR.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type OTHER.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type SHORT.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type STRING.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type TEXT.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type TIME.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration typeTIMESTAMP.
    (package private) static final SqlMetaType
    Singleton instance of String based enumeration type TO_DATE.
    (package private) static final SqlMetaType[]
    Singleton instances of generic types.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    The private constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns 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.
    The 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.
    Returns the META type with the provided name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • factory

      private static JdbcTypeFactory factory
      The private static instance of this factory.
    • ENUM_INT

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

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

      static final SqlMetaType BIG_DECIMAL
      Singleton instance of String based enumeration type BIG_DECIMAL.
    • BIG_INTEGER

      static final SqlMetaType BIG_INTEGER
      Singleton instance of String based enumeration type BIG_INTEGER.
    • BOOLEAN

      static final SqlMetaType BOOLEAN
      Singleton instance of String based enumeration type BOOLEAN.
    • BYTE_ARRAY

      static final SqlMetaType BYTE_ARRAY
      Singleton instance of String based enumeration type BYTE_ARRAY.
    • BYTE_ARRAY_WRAPPER

      static final SqlMetaType BYTE_ARRAY_WRAPPER
      Singleton instance of String based enumeration type BYTE_ARRAY_WRAPPER.
    • BYTE

      static final SqlMetaType BYTE
      Singleton instance of String based enumeration type BYTE.
    • CHAR

      static final SqlMetaType CHAR
      Singleton instance of String based enumeration type CHAR.
    • DATE_TIME

      static final SqlMetaType DATE_TIME
      Singleton instance of String based enumeration type DATE_TIME.
    • DATE

      static final SqlMetaType DATE
      Singleton instance of String based enumeration type DATE.
    • DOUBLE

      static final SqlMetaType DOUBLE
      Singleton instance of String based enumeration type DOUBLE.
    • FLOAT

      static final SqlMetaType FLOAT
      Singleton instance of String based enumeration type FLOAT.
    • FROM_DATE

      static final SqlMetaType FROM_DATE
      Singleton instance of String based enumeration type FROM_DATE.
    • INTEGER

      static final SqlMetaType INTEGER
      Singleton instance of String based enumeration type INTEGER.
    • LOCAL_DATE

      static final SqlMetaType LOCAL_DATE
      Singleton instance of String based enumeration type LOCAL_DATE.
    • LOCAL_DATE_TIME

      static final SqlMetaType LOCAL_DATE_TIME
      Singleton instance of String based enumeration type LOCAL_DATE_TIME.
    • LOCAL_TIME

      static final SqlMetaType LOCAL_TIME
      Singleton instance of String based enumeration type LOCAL_TIME.
    • INSTANT

      static final SqlMetaType INSTANT
      Singleton instance of String based enumeration type INSTANT.
    • LONG

      static final SqlMetaType LONG
      Singleton instance of String based enumeration type LONG.
    • SHORT

      static final SqlMetaType SHORT
      Singleton instance of String based enumeration type SHORT.
    • TEXT

      static final SqlMetaType TEXT
      Singleton instance of String based enumeration type TEXT.
    • STRING

      static final SqlMetaType STRING
      Singleton instance of String based enumeration type STRING.
    • TIMESTAMP

      static final SqlMetaType TIMESTAMP
      Singleton instance of String based enumeration typeTIMESTAMP.
    • TIME

      static final SqlMetaType TIME
      Singleton instance of String based enumeration type TIME.
    • TO_DATE

      static final SqlMetaType TO_DATE
      Singleton instance of String based enumeration type TO_DATE.
    • BLOB

      static final SqlMetaType BLOB
      Singleton instance of String based enumeration type BLOB.
    • CLOB

      static final SqlMetaType CLOB
      Singleton instance of String based enumeration type CLOB.
    • OTHER

      static final SqlMetaType OTHER
      Singleton instance of String based enumeration type OTHER.
    • ORACLE_CURSOR

      static final SqlMetaType ORACLE_CURSOR
      Singleton instance of auto-generated identity type ORACLE_CURSOR.
    • IDENTITY

      static final SqlMetaType IDENTITY
      Singleton instance of auto-generated identity type IDENTITY.
    • 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.
  • Constructor Details

    • JdbcTypeFactory

      private JdbcTypeFactory()
      The private constructor.
  • Method Details

    • getInstance

      public static JdbcTypeFactory getInstance()
      The main method to obtain the singleton instance of this factory.
      Returns:
      the META types factory for the JDBC stack
    • 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