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
Enlist repository parameterized types for reflection #6326
Enlist repository parameterized types for reflection #6326
Conversation
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.
Can you fix the commit message? relfection
. Thanks.
279dbc6
to
de19993
Compare
@gsmet commit message updated |
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 need to take into account hierarchy of superclasses. It happens and dealing with the superclass only is clearly not sufficient.
Or did I miss something?
+1 with @gsmet here |
@gsmet hierarchy of super classes where the direct super classes is not the parameterized one seems to be not very common but I can handle it. |
de19993
to
bde979a
Compare
@gsmet @machi1990 I climb up the hierarchy of super types in the PR. |
I will let @FroMage check that one and decide of its fate :). |
I don't understand this PR. The test you added is for when an entity type is never registered via reflection. This can only happen for Mongo, right? And only because you don't have an equivalent to So, perhaps you should have a Alternately, what you want to do is use |
@FroMage yes, when you define "mongodb entities" it's not mandatory to add the We can ask to always add the annotation, but as it's not enforced inside the framework, situations will always exist where a user will not add it ... I will refactory with |
Well, you can enforce it ;) It would be more consistent with ORM, but on the other hand this appears to be the first use-case for requiring it, and we can solve it by scanning type params, so probably we can keep that strategy for now and keep an eye out for new use-cases that would require that annotation. |
@FroMage updated with the usage of |
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.
Look @geoand we're all using this method now :)
Excellent, you all know who to direct your rage at if things don't work :P |
@gsmet ready to be merged :) |
There is an SO question about it: https://stackoverflow.com/questions/59722717/problem-with-native-image-in-quarkus-and-mongopanache |
Let's merge |
Fixes #6324
Enlist for relfection types parameters from interfaces and super classes.
This fixes the issue with the repository implementation where the repository type parameter (it should be the MongoDB persisted class) is not registered for reflection so it can fails if not direct usage is made that GraalVM can be aware of.
I didn't climb up the hierarchy of interfaces and super classes so it's still possible to have relfection issue for complex type hierarchies. I don't now if it worth it to implement it.