JdbcCustomConversions not applied to primary key on lookup [DATAJDBC-349] #571
Comments
zustse commented I can confirm this bug and it makes it impossible to connect two entities which have a uuid as primary key with a many-to-many relation. In my attached example I have two entities Person with table name person and Resource with table name resource that are connected via a ResourceRef with table name person_resource. When you take a look into this log excerpt which is produced by the test in the attached example 2020-06-06 17:55:56.260 DEBUG 47063 --- [ Test worker] o.s.jdbc.core.JdbcTemplate : Executing prepared SQL statement [DELETE FROM `person_resource` WHERE `person_resource`.`person` = ?]
2020-06-06 17:55:56.260 TRACE 47063 --- [ Test worker] o.s.jdbc.core.StatementCreatorUtils : Setting SQL statement parameter value: column index 1, parameter value [185d0f4d-d7e7-4810-ad31-f69124fe424f], value class [java.util.UUID], SQL type unknown
2020-06-06 17:55:56.267 DEBUG 47063 --- [ Test worker] o.s.jdbc.core.JdbcTemplate : Executing SQL update and returning generated keys
2020-06-06 17:55:56.267 DEBUG 47063 --- [ Test worker] o.s.jdbc.core.JdbcTemplate : Executing prepared SQL statement [INSERT INTO `person_resource` (`person`, `resource`) VALUES (?, ?)]
2020-06-06 17:55:56.268 TRACE 47063 --- [ Test worker] o.s.jdbc.core.StatementCreatorUtils : Setting SQL statement parameter value: column index 1, parameter value [[B@3c6629c6], value class [[B], SQL type -2
2020-06-06 17:55:56.268 TRACE 47063 --- [ Test worker] o.s.jdbc.core.StatementCreatorUtils : Setting SQL statement parameter value: column index 2, parameter value [[B@14d3170d], value class [[B], SQL type -2 you can see that the uuid isn't converted into binary form in the WHERE clause of the DELETE statement |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dav1dde opened DATAJDBC-349 and commented
Code:
Now querying for a StockImageEntity results in the following exception:
The Problem seems to be in org.springframework.data.jdbc.core.DefaultDataAccessStrategy#findAllByProperty:
Where rootId is the unconverted UUID. This might also be a problem for delete Operations
Attachments:
Issue Links:
("is duplicated by")
2 votes, 4 watchers
The text was updated successfully, but these errors were encountered: