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

Add fix to use Field annotation in entity methods(getters) #88

Open
ArtDu opened this issue Feb 18, 2022 · 0 comments
Open

Add fix to use Field annotation in entity methods(getters) #88

ArtDu opened this issue Feb 18, 2022 · 0 comments
Labels

Comments

@ArtDu
Copy link
Contributor

ArtDu commented Feb 18, 2022

Now it doesn't work like that, see the test here:
#87

It is also worth considering that findMergedAnnotation is a performance-heavy method, so should cache getting annotations or come up with something so as not to use annotation search for each parameter field in each call request

@Override
    public String getFieldName() {
        Field annotationField = AnnotatedElementUtils.findMergedAnnotation(getField(), Field.class);

        if (annotationField != null && StringUtils.hasText(annotationField.value())) {
            return annotationField.value();
        }

        return fieldNamingStrategy.getFieldName(this);
    }
@ArtDu ArtDu changed the title Add support to use Field annotation in entity methods Add fix to use Field annotation in entity methods Feb 18, 2022
@ArtDu ArtDu changed the title Add fix to use Field annotation in entity methods Add fix to use Field annotation in entity methods(getters) Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants