-
Notifications
You must be signed in to change notification settings - Fork 356
Query method with bind parameter List<byte[]> does no longer work #1900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If you are dealing with UUIDs it assume that actually using the UUID type both in the database an in Java probably does work better. That said, I still consider this a regression and we'll look into it. |
I totally agree with this, it will be simpler 👍 |
byte[] is mapped to BINARY data and is not considered tuple data. The explicit check for byte[] is not very nice but matches the special handling in MappingJdbcConverter.writeJdbcValue Closes #1900
Hello, the following example doesn't work any more after upgrading spring-boot version from
3.3.2
to3.3.3 / 3.3.4.
uuid is a BINARY(16) column in a table in MariaDB 10.6.18.
It looks like the problem is caused by this fix in the class
org.springframework.data.jdbc.repository.query.StringBasedJdbcQuery
.I debugged a bit and it looks like in the version
3.3.3
in the functionStringBasedJdbcQuery.bindParameters(RelationalParameterAccessor accessor)
a new function writeValue is called which iterates through each byte[] using writeJdbcValue and gets a jdbcValue for each byte in the array - jdbcType VARBINARY. The end result of the bindParameters' value is ArrayList<Object[16]> with Byte items.If I understand correctly in the
3.3.2
version thebindParameters
function usesconvertAndAddParameter
which callswriteJdbcValue
for a byte[] and the resultjdbcType
isBINARY
. The result value ofbindParameters
isArrayList<byte[]>
.The error for
List.of([-8, 7, -57, -71, -23, -77, 70, 24, -70, -19, -113, 98, -9, 0, 121, 119])
Maybe a check for treating List<byte[]> should be added to differentiate from the tuple processing ?
Thanks in advance !
The text was updated successfully, but these errors were encountered: