Class MappingGenerator.SQLTypeUtil

  • Enclosing class:
    MappingGenerator

    public static class MappingGenerator.SQLTypeUtil
    extends Object
    The contents of this class will eventually be added to SQLTypeUtil in dbmodel. It is an util class which provides methods for jdbc type compatible and jdbc attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      SQLTypeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Collection getCompatibleTypes​(int jdbcType)
      Returns a collection of compatible jdbc types.
      static boolean hasLength​(int jdbcType)
      This method returns true if the jdbc type has length
      static boolean hasPrecision​(int jdbcType)
      This method returns true if the jdbc type has precision.
      static boolean hasScale​(int jdbcType)
      This method returns true if the jdbc type has scale.
      static boolean isBlob​(int jdbcType)
      Returns if a given data type is blob type or not.
      static boolean isCharacter​(int jdbcType)
      Returns if the given data type is character type or not.
      static boolean isNumeric​(int jdbcType)
      Returns if the given data type is numeric type or not.
      static boolean isTime​(int jdbcType)
      Returns if a given data type is time type or not.
    • Constructor Detail

      • SQLTypeUtil

        public SQLTypeUtil()
    • Method Detail

      • isNumeric

        public static boolean isNumeric​(int jdbcType)
        Returns if the given data type is numeric type or not.
        Parameters:
        jdbcType - the type from java.sql.Types
        Returns:
        true if the given type is numeric type; false otherwise
      • isCharacter

        public static boolean isCharacter​(int jdbcType)
        Returns if the given data type is character type or not.
        Parameters:
        jdbcType - the type from java.sql.Types
        Returns:
        true if the given type is character type; false otherwise
      • isBlob

        public static boolean isBlob​(int jdbcType)
        Returns if a given data type is blob type or not.
        Parameters:
        jdbcType - the type from java.sql.Types
        Returns:
        true if the give type is blob type; false otherwise
      • isTime

        public static boolean isTime​(int jdbcType)
        Returns if a given data type is time type or not.
        Parameters:
        jdbcType - the type from java.sql.Types
        Returns:
        true if the give type is time type; false otherwise
      • getCompatibleTypes

        public static Collection getCompatibleTypes​(int jdbcType)
        Returns a collection of compatible jdbc types.
        Parameters:
        jdbcType - the type from java.sql.Types
        Returns:
        a collection of compatible jdbc types
      • hasScale

        public static boolean hasScale​(int jdbcType)
        This method returns true if the jdbc type has scale.
        Parameters:
        jdbcType - a jdbc type from java.sql.Types
        Returns:
        true if the type has scale; false otherwise
      • hasPrecision

        public static boolean hasPrecision​(int jdbcType)
        This method returns true if the jdbc type has precision. If the jdbc type has the precision, it means it also has scale.
        Parameters:
        jdbcType - a jdbc type from java.sql.Types
        Returns:
        true if the type has precision; false otherwise
      • hasLength

        public static boolean hasLength​(int jdbcType)
        This method returns true if the jdbc type has length
        Parameters:
        jdbcType - a jdbc type from java.sql.Types
        Returns:
        true if the type has length; false otherwise