Skip to content
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

Allow @Query on POJO-methods, refs #704 #732

Merged
merged 4 commits into from
Apr 6, 2021

Conversation

ybroeker
Copy link
Contributor

@ybroeker ybroeker commented Apr 6, 2021

This PR allows to use �@Query on POJO-methods, so methods don't need to be prefixed with get/is.

#704 should not be closed yet, native record support would still be desirable. But at least it allows to annotate components with @Query instead of implementing additional getters.

I'm not sure what the backport policy is, if desired I can add that to 1.0.x as well.

ybroeker added 4 commits April 6, 2021 14:43
MethodName should be null (since no method is used) and fieldName should just
be the fields name, without removing an get/is/set prefix.

Could be used later to distinguish between direct field access an access by
method.

Signed-off-by: Yannick da Silva Bröker <[email protected]>
@phillip-kruger phillip-kruger added this to the 1.2.0 milestone Apr 6, 2021
@phillip-kruger phillip-kruger merged commit 7e47d44 into smallrye:main Apr 6, 2021
@phillip-kruger
Copy link
Member

Yes please backport as well
Thanks @ybroeker !

phillip-kruger added a commit that referenced this pull request Apr 6, 2021
@ybroeker ybroeker deleted the feat/propertyFetching branch April 6, 2021 13:24
@phillip-kruger
Copy link
Member

Hi @ybroeker, hope you are well, seems this PR broke Quarkus in native mode :(
see quarkusio/quarkus#17349

I'll look at this a.s.a.p, but if you have an idea what the problem is, please share :)

@ybroeker
Copy link
Contributor Author

Apparently MethodHandles have to be enabled via an explicit flag in Graalvm 20.3 (at least the part that is used), and full support has only been added with 21.0 (oracle/graal#2761).

It should be easy to replace MethodHandles in FieldDataFetcher, they are only used to be able to access fields and methods in the same way.

Can create a pull request later

@phillip-kruger
Copy link
Member

Great ! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants