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

Improve support for Java records as Agrest entities #614

Closed
andrus opened this issue Mar 6, 2023 · 0 comments
Closed

Improve support for Java records as Agrest entities #614

andrus opened this issue Mar 6, 2023 · 0 comments
Milestone

Comments

@andrus
Copy link
Contributor

andrus commented Mar 6, 2023

Currently to turn a Java 17 "record" into an Agrest entity, we need to create old style getters. E.g.:

public record MyRecord(String p1, String p2) {

    @AgAttribute
    public String getP1() {
        return p1;
    }

    @AgAttribute
    public String getP2() {
        return p2;
    }
}

This works, but I wish it would look a bit more native like this:

public record MyRecord(@AgAttribute String p1, @AgAttribute String p2) {}

This is achievable without an explicit Java 17 dependency. This issue depends on redefining "properties" per #618

@andrus andrus changed the title Support for java records as Agrest entities Support for Java records as Agrest entities Mar 6, 2023
@andrus andrus changed the title Support for Java records as Agrest entities Improve support for Java records as Agrest entities Mar 6, 2023
@andrus andrus added this to the 5.0.M15 milestone Mar 12, 2023
@andrus andrus closed this as completed Mar 12, 2023
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

No branches or pull requests

1 participant