-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for 5274 #5276
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
Fix for 5274 #5276
Conversation
If the entity type is not fixed in the hierarchy yet, don't generate the bridge Fix quarkusio#5274
@loicmathieu do you have time to review this? I took the liberty to fix the same bug for mongo-panache. |
@gsmet this is a candidate fix for 1.0 as it's simple, tested, low-risk and affects an existing user. How do I need to tag it? |
|
||
// Bridge for findById, but only if we actually know the end entity (which we don't for intermediate | ||
// abstract repositories that haven't fixed their entity type yet | ||
if (!"Ljava/lang/Object;".equals(entitySignature)) { |
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.
Why don't you just avoid any enahcement for abstract repositories/entities ?
This way it will speed up the build process no ?
And you will also be able to remove some cheks inside the processor as PanacheEntity itself is abstract
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.
Because this also happens for non-abstract classes, as my test shows.
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
@GET | ||
@Path("5274") | ||
@Transactional | ||
public String testBug5274() { |
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.
Maybe named it testWithAbstractParentEntity and add a link to the bug will be more explainatory ?
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 prefer having the issue number in the test name because that really has more info than whatever name I could come up with. We could add a link as comment, but I've never felt the need for it.
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, as you prefere :)
Huh, it doesn't look like your review is enough. @gsmet ? |
Please use the Backport? Tag.
Please try to reduce the number of commits to what’s necessary for proper semantic
… Le 7 nov. 2019 à 14:07, Stéphane Épardaud ***@***.***> a écrit :
@FroMage commented on this pull request.
In integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java:
> @@ -789,4 +789,15 @@ public Person ignoredProperties() throws NoSuchMethodException, SecurityExceptio
person.status = Status.DECEASED;
return person;
}
+
+ @Inject
+ Bug5274EntityRepository bug5274EntityRepository;
+
+ @get
+ @path("5274")
+ @transactional
+ public String testBug5274() {
I prefer having the issue number in the test name because that really has more info than whatever name I could come up with. We could add a link as comment, but I've never felt the need for it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
4 commits: two fixes, two tests. I can squash them if you prefer. |
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
* Panache: do not create findById bridge for abstract entity repositories If the entity type is not fixed in the hierarchy yet, don't generate the bridge Fix quarkusio#5274 * Test for quarkusio#5274: duplicate findById for abstract repositories * Fix quarkusio#5274 for Mongo too * Test for quarkusio#5274 for Mongo
* Panache: do not create findById bridge for abstract entity repositories If the entity type is not fixed in the hierarchy yet, don't generate the bridge Fix quarkusio#5274 * Test for quarkusio#5274: duplicate findById for abstract repositories * Fix quarkusio#5274 for Mongo too * Test for quarkusio#5274 for Mongo
No description provided.