Open
Conversation
Not all databases support the JDBCSqlType.NULL. Therefore this handling was made dialect dependent, with SQL Server and DB2 using the old approach, while all others use JDBCSqlType.NULL In the process modified AbstractJdbcConfiguration to use JdbcDialect instead of Dialect. Original pull request #2068 See #1935 See #2031
serezakorotaev
approved these changes
Jun 4, 2025
mp911de
reviewed
Jun 5, 2025
| * Implementation that always uses {@link JDBCType#NULL}. Suitable for all databases that actually support this | ||
| * {@link JDBCType}. | ||
| */ | ||
| NullTypeStrategy DEFAULT = sqlType -> JDBCType.NULL; |
Member
There was a problem hiding this comment.
We should have more meaningful names. Something like NULL_VALUE instead of DEFAULT
mp911de
requested changes
Jun 5, 2025
Member
mp911de
left a comment
There was a problem hiding this comment.
I'm not quite sure this is the best way to approach the problem because we're introducing configuration complexity on our side how to massage the JDBC driver.
In R2DBC, we've solved the issue of writing null values by considering these in the SQL statement using NULL instead of a parameter bind marker. That seems much easier than figuring out (and potentially asking the database to obtain) a SQL type number for a null value.
| * {@link SQLType} to use for {@literal null} values. | ||
| * | ||
| * @param sqlType a fallback value that is considered suitable by the caller. | ||
| * @return Guaranteed not to be {@literal null}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is based on #2068.
Not all databases support the JDBCSqlType.NULL.
Therefore this handling was made dialect dependent, with SQL Server and DB2 using the old approach, while all others use JDBCSqlType.NULL
In the process modified AbstractJdbcConfiguration to use JdbcDialect instead of Dialect.
Closes #1935