Interface JdbcType

    • Method Detail

      • getFriendlyName

        default String getFriendlyName()
        A "friendly" name for use in logging
      • getDefaultSqlTypeCode

        default int getDefaultSqlTypeCode()
        A JDBC type code that identifies the SQL column type.

        This value might be different from getDdlTypeCode() if the actual type e.g. JSON is emulated through a type like CLOB.

        Returns:
        a JDBC type code
      • getJdbcLiteralFormatter

        default <T> JdbcLiteralFormatter<T> getJdbcLiteralFormatter​(JavaType<T> javaType)
        Obtain a formatter object capable of rendering values of the given Java type as SQL literals of the type represented by this object.
      • getBinder

        <X> ValueBinder<X> getBinder​(JavaType<X> javaType)
        Obtain a binder object capable of binding values of the given Java type to parameters of a JDBC PreparedStatement.
        Parameters:
        javaType - The descriptor describing the types of Java values to be bound
        Returns:
        The appropriate binder.
      • getExtractor

        <X> ValueExtractor<X> getExtractor​(JavaType<X> javaType)
        Obtain an extractor object capable of extracting values of the given Java type from a JDBC ResultSet.
        Parameters:
        javaType - The descriptor describing the types of Java values to be extracted
        Returns:
        The appropriate extractor
      • getPreferredJavaTypeClass

        @Incubating
        default Class<?> getPreferredJavaTypeClass​(WrapperOptions options)
        The Java type class that is preferred by the binder or null.
      • getCheckCondition

        default String getCheckCondition​(String columnName,
                                         JavaType<?> javaType,
                                         BasicValueConverter<?,​?> converter,
                                         Dialect dialect)
        The check constraint that should be added to the column definition in generated DDL.
        Parameters:
        columnName - the name of the column
        javaType - the JavaType of the mapped column
        converter - the converter, if any, or null
        dialect - the SQL Dialect
        Returns:
        a check constraint condition or null
        Since:
        6.2
      • wrapTopLevelSelectionExpression

        @Incubating
        default Expression wrapTopLevelSelectionExpression​(Expression expression)
        Wraps the top level selection expression to be able to read values with this JdbcType's ValueExtractor.
        Since:
        6.2
      • wrapWriteExpression

        @Incubating
        default String wrapWriteExpression​(String writeExpression,
                                           Dialect dialect)
        Wraps the write expression to be able to write values with this JdbcType's ValueBinder.
        Since:
        6.2
      • appendWriteExpression

        @Incubating
        default void appendWriteExpression​(String writeExpression,
                                           SqlAppender appender,
                                           Dialect dialect)
        Append the write expression wrapped in a way to be able to write values with this JdbcType's ValueBinder.
        Since:
        6.2
      • isInteger

        default boolean isInteger()
      • isFloat

        default boolean isFloat()
      • isDecimal

        default boolean isDecimal()
      • isNumber

        default boolean isNumber()
      • isBinary

        default boolean isBinary()
      • isString

        default boolean isString()
      • isStringLike

        default boolean isStringLike()
      • isTemporal

        default boolean isTemporal()
      • isLob

        default boolean isLob()
      • isLob

        static boolean isLob​(int jdbcTypeCode)
      • isLobOrLong

        default boolean isLobOrLong()
      • isLobOrLong

        static boolean isLobOrLong​(int jdbcTypeCode)
      • isNationalized

        default boolean isNationalized()
      • isNationalized

        static boolean isNationalized​(int jdbcTypeCode)
      • isInterval

        default boolean isInterval()
      • isDuration

        default boolean isDuration()
      • getCastType

        default CastType getCastType()
      • getCastType

        static CastType getCastType​(int typeCode)