Correct, @NotNull from the Jakarta Validation specification is a constraint that is validated on the Java object and when you pass an entity to persist, it obviously does not have a value set, since that will be generated. So the Jakarta Validation error would be inevitable, though I agree that this is a bit unfortunate. Can you please create a new Jira ticket for this i.e. Jakarta Validation error for @NonNull to be non-sensical with generators? Either we have to skip validating attributes that have generators or throw a boot error to notify users.
@beikov thanks for the response, this makes sense. I tried logging a ticket at Jira , but Create button just does nothing. It seems like something about Atlassian authentication, bunch of 401/400 errors in console, even though I am logged in, tried in different browser/account, same story - Create button does not do anything.
Thanks for reporting the problem. We recently figured out that most of the problems come when you authenticate via an external SSO provider. Also see the discussion in our chat: #hibernate-user > Jira issue creation
It seems you must “join” the Hibernate Jira first. There should be a “Log In” Button in the Account-Popup (where it has links to Profile and Account Settings). After clicking it, you should be prompted to join Hibernate’s Jira.
Alright, clicking account icon → Login does help. Another annoying thing is that the banner is displayed only after you do that . While you are authenticated, but before clicking that another Login thing, the banner is not displayed .
Anyways, while I was writing a ticket, I checked the sources again and found that this not-null schema validation was reverted altogether, and is not present in 7.2.2 anymore . @beikov if you like I can still log a ticket, but I don’t see much value in it anymore, as 7.2.2 behaves exactly as I would want it to, i.e. “treat generated fields as not nullable for schema validation purposes“ or just “do not perform not-null schema validation on generated fields“.