Closed Rattenkrieg closed 5 days ago
Thanks a lot for your report. I can see how this could be reasonably expected to work, given that setters and getters allow this call as well for non-replacing embeddables. Things work as expected with replacing embeddables, including embedded keys: https://www.jooq.org/doc/latest/manual/code-generation/codegen-embeddable-types/codegen-embedded-keys/
With non-replacing embeddables, the workaround is to simply iterate over the embeddable's fields and to reset them individually.
The Record.original(Field)
and Record.touched(Field)
(previously Record.changed(Field)
) methods are also affected
With non-replacing embeddables, the workaround is to simply iterate over the embeddable's fields and to reset them individually.
Yep, this is how I patched if for now
/// works
for (var field : COMPOSITE_KEY_EXAMPLE.COMPOSITE_ID.getTable().fields()) {
record.reset(field);
}
Thank you!
Fixed in versions:
Expected behavior
I have an embeddable composite field consisting of two columns. I get IllegalArgumentException when I try to reset this field in the record
MCVE: https://github.com/Rattenkrieg/jOOQ-mcve/pull/1/files
Actual behavior
Steps to reproduce the problem
jOOQ Version
Open source edition 3.19.13
Database product and version
postgres:latest
Java Version
openjdk 21
JDBC / R2DBC driver name and version (include name if unofficial driver)
org.postgresql:postgresql:42.7.2