JavaBeans defines naming conventions that let generic Java tools discover and manipulate object properties. A property typically uses a private or protected field with an accessor pair: getProperty() retrieves its value and setProperty(value) changes it. Boolean properties may use isProperty() instead of getProperty(). section 3.2.3
A conventional property
A User property named username follows the convention with getUsername() and setUsername(String username). The methods can preserve encapsulation while exposing the property to persistence and other generic tools. section 3.2.3
Hibernate does not require accessors for persistence. It can call accessor methods or access fields directly, allowing selected accessors to be non-public, omitted, or replaced by configured field access. section 3.2.3
