Closed Tree4Free closed 1 week ago
I tried to reproduce the issue but failed
Please provide a Minimimal Reproducable Example, preferable as a Github repository. Make sure to include the database, either as an in memory database or if that is not possible using Testcontainers.
Here is the repo:
https://github.com/Tree4Free/spring-data-jdbc-issue-1826
I used a postgres testcontainer because thats where I also discovered the issue in my code.
You can find the failing test under com.example.springjdbcnullissue.SpringJdbcNullIssueApplicationTests#testNullTextArray
(JDK used is 21)
When changing the version of the org.springframework.boot
plugin in the build.gradle.kts
to 3.3.0
from 3.3.1
the test case succeeds.
As written in this comment https://github.com/spring-projects/spring-data-relational/issues/1737#issuecomment-2189169423 after upgrading to spring-data-jdbc
3.3.1
when I load an entity with atext[]
column (mapped asList<String>
) that is empty usingfindById
the column is set tonull
.My guess is that bug was introduced by this issue https://github.com/spring-projects/spring-data-relational/issues/1737 but I didn't look into the changes to confirm that.
An example of my setup taken from the comment linked above:
Using a combination of Java + Kotlin: My Entity: (Java + Lombok)
My database table (postgres):
My test case (Kotlin)