-
-
Notifications
You must be signed in to change notification settings - Fork 102
Support @IdGeneratorType #2380
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
Support @IdGeneratorType #2380
Conversation
| } | ||
|
|
||
| @Override | ||
| default Id generate( |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
generate
| } | ||
|
|
||
| @Override | ||
| default Object generate(SharedSessionContractImplementor session, Object object){ |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
generate
DavideD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I gave it a quick look, but I will check better tomorrow
| public void testPersist(VertxTestContext context) { | ||
| Person person = new Person(); | ||
| test( | ||
| context, openSession() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use getMutinySessionFactory.withTransaction?
I think it's more similar to a typical use case.
Maybe we could also test without transactions, but we should at least add a comment to explain what's going on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to also read the value from the database to make sure that they match? Maybe it's overkill
| context, openSession() | ||
| .thenCompose( session -> session.persist( person ) ) | ||
| .thenAccept( v -> { | ||
| assertThat( person.getId() ).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that this test is wrong because the id is a primitive type so it's never going to be null
|
I will send a PR rebased to the latest changes |
Fix #1906