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
Panache reactive based on Hibernate Reactive #10769
Conversation
Missing docs. |
oh, nice, do you have a link to an example? |
Line 56 in 592c911
But there's so much stuff in these tests that it really doesn't do justice to the API. |
Right, I was more looking for an example app than tests. |
I'll add a quickstart too |
71f4932
to
66cd30a
Compare
- "panache" | ||
- "hibernate" | ||
- "jpa" | ||
guide: "https://quarkus.io/guides/hibernate-orm-panache" |
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.
You won't have a specific guide?
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.
We will, but there's no guide yet, as is the case for HR.
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.
In that case, better remove the guide than pointing to an inappropriate one.
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.
OK.
I suppose we want that for 1.7. What's the plan for the reviews? |
Well, CI finally seems to pass, so let's get this out of draft. |
What I was asking is who will review it? Personally, I don't know much about Panache and I know nothing about reactive so I won't. Can you find some people who will get that reviewed and merged before CR1? |
I can have a look, but "104 files changes" .. gosh I only have an hour I can spare today :) |
@DavideD could you have a look as well? If you could focus on checking if the Hibernate Reactive APIs seem used correctly, I'll focus on integration risks. |
extensions/panache/panache-mock/src/main/java/io/quarkus/panache/mock/PanacheMock.java
Outdated
Show resolved
Hide resolved
extensions/panache/panache-mock/src/main/java/io/quarkus/panache/mock/PanacheMock.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
public Uni<Void> persist(Mutiny.Session em, Object entity) { | ||
if (!em.contains(entity)) { |
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.
What is the purpose of this check? And why should it not be persisted otherwise?
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.
Also, why is this specific variation of the persist
method having this check, but the other methods won't have the same semantics?
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.
The purpose is to not call persist
if it's already persisted. The ORM version has the same check. What happens if I call persist
on an already persisted entity, otherwise?
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.
The other variations of persist
ultimately call this, so it's fine.
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.
What happens if I call persist on an already persisted entity, otherwise?
Nothing, but at least we have a chance to verify the transaction is alive, extend timeouts, and things like that.
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.
Well, the javadoc wasn't entirely clear about the semantics here.
...rc/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/AbstractJpaOperations.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/AbstractJpaOperations.java
Outdated
Show resolved
Hide resolved
...c/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/CommonPanacheQueryImpl.java
Outdated
Show resolved
Hide resolved
</plugins> | ||
</build> | ||
|
||
<profiles> |
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.
Don't we normally have integration tests in the /integration-tests
directory, in the root of the Quarkus source tree?
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.
Those are for the hot-reload. They mirror what we have for ORM with Panache, except that one could run without docker because H2, which we don't support ATM for reactive. I could move them to the existing IT, but that'd be less symmetrical and I still hope we will support H2 for reactive at some point and get rid of this docker requirement.
...java/io/quarkus/hibernate/reactive/panache/deployment/PanacheHibernateResourceProcessor.java
Outdated
Show resolved
Hide resolved
|
||
@Test | ||
void shouldThrow() { | ||
fail("A BuildException should have been thrown due to duplicate entity ID"); |
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.
So Panache can't deal with composite IDs ?
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.
IIRC this detects the case where you have multiple @Id
annotations but no matching @IdClass
which is always a blunder.
simple enough. shouldn't conflict with what I have in motion. fwiw, I'm working on reducing the number of those enhancers/visitors which will reduce the maintenance burden there. |
3016d33
to
3ca5424
Compare
Added a new method to guard against future copying of null parameter names, and rebased to resolve HR conflicts. |
3ca5424
to
a8a19fc
Compare
Fixed the damn formatting. |
All the failures are unrelated:
Let's restart. |
Removing the dump must have been an oversight. |
Rebased to get rid of kubernetes test failing. |
a8a19fc
to
c805c9b
Compare
Failure in the |
To make sure we don't add producers that depend on something that ORM didn't add
Mockito doesn't know how to mock package-private methods. This only works if we're mocking the ClientProxy class instead of the real bean class.
c805c9b
to
74d8b71
Compare
Let's rebase. |
Yay! |
Wow! very nice |
Cool ! I need to test this ! |
Great! |
@FroMage ,this PR has include in 19.CR1, Could you provide some documents for this PR? |
Probably a few things left to fix, but at least all the tests pass, so a good candidate for running tests in CI.