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
IllegalArgumentException when calling UpdatableRecord methods on tables with embedded domains that replace their underlying fields #15873
Comments
MCVE available here: https://github.com/NorbertKawinski/jOOQ-mcve EDIT: Probably related, the embedded keys generation have the same issue. |
Thanks a lot for your report. I'll look into this right away. |
Yeah, I can reproduce it, with or without defaults. |
Stack trace of the new integration test:
|
The problem is that the generated However, it's probably possible to fix this even without the above change, and backport the fix. |
As hinted by the call stack, the other
|
Another related issue that will be fixed with this one: |
This only happens when the embeddable replaces the underlying column(s) |
Duplicate of #12689 |
Fixed in versions:
Thanks again for your report! I will continue investigating related edge cases (e.g. embeddable keys, keys combining domains and non-embeddables) to see if other, related problems still exist. Will link to further issues from here. |
…s on tables with embedded domains that replace their underlying fields
methods on tables with embedded domains that replace their underlying fields
methods on tables with embedded domains that replace their underlying fields
methods on tables with embedded domains that replace their underlying fields
I realise there was a comment here:
What did you mean by this? Enabling both embedded keys and domains? This is currently not working due to the inability to nest embeddables: Or did you have something else in mind? |
Another issue when a composite key referneces a domain type: |
Ah, no, not that complex with nesting, sorry for not being clear :) Actually this is how I first bumped into this issue because I started generating the embedded keys. If you'd like to see what I mean, then I updated my MCVE with "embeddablePrimaryKeys" |
I see, I'll check that as well, thanks. When combining the two flags (which isn't unlikely), then, nesting would have to occur, though. The domain generates an embeddable first, and then the key generates another one after, based on the first. This doesn't work yet. |
I can confirm, this fixes also the case of using |
Expected behavior
New record is created in the database
Actual behavior
Steps to reproduce the problem
For such database:
Generated with
embeddableDomains = ".*"
This code
throws an exception.
Without the
embeddableDomains
flag, everything works fine.jOOQ Version
org.jooq.trial:jooq:3.18.7
Database product and version
postgres:16.1-alpine Docker image
Java Version
Openjdk 21.0.1
OS Version
Microsoft Windows 11 Pro [10.0.22621 Build 22621]
JDBC driver name and version (include name if unofficial driver)
org.postgresql:postgresql:42.6.0
The text was updated successfully, but these errors were encountered: