-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EXPOSED-382 ClassCastException when uuid().references() is used …
…with EntityID column (#2079) Using references() invoked on a UUIDColumnType that targets an EntityIDColumnType<UUID> causes a ClassCastException. This occurs because PreparedStatementApi.fillParameters() tries to get the valueToDB() from EntityIDColumnType rather than the underlying UUIDColumnType and it is not possible to cast the refValue UUID to EntityID<UUID>. This exception does not happen with Int- or LongColumnType because their EntityID variants are wrapped as AutoIncColumnTypes that delegate to the correct underlying type. And this also doesn't happen if reference() is used because it creates an EntityIDColumnType under-the-hood which avoids type mismatch. This was most likely always happening but only causes an issue now that a stricter column type-safety has been introduced, which does not tolerate well a foreign key constraint between columns of different types.
- Loading branch information
Showing
4 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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