Skip to content

Conversation

@parazit-IR
Copy link

This PR addresses GH-2188 (Converters with JDBCType.OTHER broken).

Summary

Custom converters that return JdbcValue with JDBCType.OTHER stopped working correctly for string-based queries.
StringBasedJdbcQuery treated JDBCType.OTHER as a special case and did not register its SQL type when binding parameters, so the JDBC driver did not see Types.OTHER anymore.

Changes

  • Update StringBasedJdbcQuery.bindParameters(…) to register the SQL type for all non-null SQLType values, including JDBCType.OTHER, and only fall back to the type-less addValue(name, value) overload when the JDBC type is actually null.
  • Add a regression test to StringBasedJdbcQueryUnitTests that:
    • uses a custom @WritingConverter returning JdbcValue.of(…, JDBCType.OTHER),
    • executes a string-based query method,
    • and asserts that the resulting SqlParameterSource exposes Types.OTHER for the bound parameter.

This restores the behavior for PostgreSQL enum/custom types and other use cases that rely on JDBCType.OTHER in custom converters.

Closes #2188

Signed-off-by: Mohammadali Jalalkamali <m.ali.jalalkamali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mapping failure with Composite Key and Inherited Audit Fields - Kotlin

2 participants