-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 of Embedded and XXXToOne nested object projection + Support of @ProjectedFieldName on class fields #36594
Conversation
If I understand it correctly, the Also, the documentation for projection should be updated. |
"Also, the documentation for projection should be updated." , yes if you agree with the proposal , I will udpate the documentation |
What I don't understand in your example is why the PersonDTO extends PeronsName and why it has the annotation in it. That's why I asked for a simple example. |
PersonName is the original DTO in integration test , I ve created PersonDTO that extend it to keep the original test and I've included Embbeded (DescriptionDTO) and ManyToOne ( AdressDTO) elements in it. It allow me to test different case with this DTO. "Why there is an annotation in it ?" Good question. We have 3 choices:
|
It is clearer to me, its behavior will be well defined.
Please let the current test as is and add a new one so we test both a simple projection and a more complex one. |
---> Ok , perhaps in that case we can rename it to NestedProjectedClass to be more precise ?
--> I didn't change the current test with simple Projection ( PersonName), it's just my new test use a new DTO ( PersonDTO) that inherit from the simple (PersonName) to avoid to duplicate the projection of simple field. And to test the inheritance, I had some issue with inheritance with the constructor part. |
I've added simple example + doc, and renamed annotation. |
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
Let me fix the jdk11 + native issue and i will come back to you. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Overall, the PR seems more complex than needed.
There seem to be multiple functionalities in one PR and the tests seem contain more than just what's needed for the functionality.
This makes it complex to review so I didn't finish it yet.
...mmon/runtime/src/main/java/io/quarkus/hibernate/orm/panache/common/NestedProjectedClass.java
Outdated
Show resolved
Hide resolved
...on-tests/hibernate-reactive-panache/src/main/java/io/quarkus/it/panache/reactive/Person.java
Outdated
Show resolved
Hide resolved
...on-tests/hibernate-reactive-panache/src/main/java/io/quarkus/it/panache/reactive/Person.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Yes you right , the PR is complex because it handles the recursivity of nested objects. And I included one test for #28844. |
This comment has been minimized.
This comment has been minimized.
Hi @loicmathieu , It should be good now, could you have a look please? |
This comment has been minimized.
This comment has been minimized.
add testenpoint, remove comment, simplify getConstructor, rename getParametersFromClass,
…otated with @NestedProjectedClass + Remove test from PanacheFunctionalityTest, just use TestEndpoint test as requested by @loicmathieu
Hi @loicmathieu @geoand , @zakkak Do you think it's possible to have this PR in 3.7.x ? |
This comment has been minimized.
This comment has been minimized.
add testenpoint, remove comment, simplify getConstructor, rename getParametersFromClass,
…otated with @NestedProjectedClass + Remove test from PanacheFunctionalityTest, just use TestEndpoint test as requested by @loicmathieu
This comment has been minimized.
This comment has been minimized.
Thanks for this. We will certainly need to the commits to be cleaned up / squashed |
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.
LGTM, thanks for doing this and your patience for the long review process!
@humcqc can you please squash your commits in one commit so we can merge it? |
…f @ProjectedFieldName on class fields
Sure, Done! |
Status for workflow
|
Fixes #36581
Support of Embedded and ManyToOne nested object projection + Support of @ProjectedFieldName on class fields
Documentation not updated yet, will do it when we agree on the code.