0

JPA property access: getter and setter. Does it support isMethod for boolean? For example,

@Entity
@Access(AccessType.PROPERTY)   
public class Foo {
   private boolean closed;


   public boolean isClosed() {
       return this.closed;
   }

}

Could not find relevant info in JPA spec 2.1.

Minar Mahmud
  • 2,577
  • 6
  • 20
  • 32
eastwater
  • 4,624
  • 9
  • 49
  • 118

1 Answers1

1

Yes. It does.

From JSR 338: JavaTM Persistence API, Version 2.1

2.2 Persistent Fields and Properties

...for every persistent property property of type T of the entity, there is a getter method, getProperty, and setter method setProperty. For boolean properties, isProperty may be used as an alternative name for the getter method.

Minar Mahmud
  • 2,577
  • 6
  • 20
  • 32