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

Is it possible to have different getter and setter types to the property field? #217

Open
RichardInnocent opened this issue Jan 16, 2020 · 0 comments

Comments

@RichardInnocent
Copy link

RichardInnocent commented Jan 16, 2020

Let's say I have this class...

@Entity
public class Foo {

  @Property
  private final AtomicInteger count = new AtomicInteger(0);

  public void setCount(int value) {
    count.set(value);
  }

  public int getCount() {
    return count.get();
  }
}

At the moment, this throws a NoAccessorMethodException: Class ... requires a public accessor method for field count when saving.

Is it possible to "ignore" the field type and save like this? Exposing an AtomicInteger setter breaks abstraction (and thread safety in this case).

@RichardInnocent RichardInnocent changed the title Is it possible to have different getter and setter method types to the property? Is it possible to have different getter and setter types to the property field? Jan 16, 2020
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