You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a problem with null enum values and JDBI v3.5.1
The enum is represented as a VARCHAR in the database, just like the default representation recommended by JDBI. If, however, I try to insert a null value through an SqlObject, the null value is set as type OTHER. This causes a type error, at least with an Oracle database.
Looking into BuiltinArgumentFactory (or EnumArgument in master), it seems that null values are always bound with getUntypedNullArgument. I was able to work around this issue by registering a custom ArgumentFactory like this:
Is the current behavior intended? Or would you accept a change to EnumArgument that includes the null-handling as shown in the. custom argument factory?
The text was updated successfully, but these errors were encountered:
This is definitely a bug, and normally we'd fix it independently of a new feature. But since we already have a PR open that fixes this in addition to other new features, we'll let it get merged in.
hi @rherrmann we've merged some Enum changes ( #1427 ) but I don't personally have an oracle database to test. Can you build jdbi from after that change and verify that we've fixed your issue (and not broken anything else)? Thanks!
(We had to remove Oracle build and tests from main jdbi because of the ridiculous Maven setup required, and Oracle's inability to reliably host their jdbc driver)
I am having a problem with null enum values and JDBI v3.5.1
The enum is represented as a VARCHAR in the database, just like the default representation recommended by JDBI. If, however, I try to insert a null value through an SqlObject, the null value is set as type
OTHER
. This causes a type error, at least with an Oracle database.Looking into
BuiltinArgumentFactory
(orEnumArgument
in master), it seems that null values are always bound withgetUntypedNullArgument
. I was able to work around this issue by registering a customArgumentFactory
like this:Is the current behavior intended? Or would you accept a change to
EnumArgument
that includes the null-handling as shown in the. custom argument factory?The text was updated successfully, but these errors were encountered: