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

Option to use model getters/setters #22

Closed
nhaarman opened this issue Nov 14, 2014 · 1 comment
Closed

Option to use model getters/setters #22

nhaarman opened this issue Nov 14, 2014 · 1 comment

Comments

@nhaarman
Copy link

It would be nice to see an option to use getters and setters when loading and saving models.

For instance:

@Model("items")
public class Item {

    @Column(value = "name", useGetterAndSetter = true)
    private String mName;

    public String getName() {
        return mName;
    }

    public void setName(String name) {
        mName = name;
    }
}

Alternatively, use @Getter and @Setter annotations. I'm not familiar with annotation processing, so I'm not sure what would be the easier way to implement.

@Model("items")
public class Item {

    @Column("name")
    private String mName;

    @Getter("name")
    public String getName() {
        return mName;
    }

    @Setter("name")
    public void setName(String name) {
        mName = name;
    }
}
@nhaarman
Copy link
Author

My apologies, I totally missed #15.

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