4.2.1.1. Entity Fields Initialization
Simple attributes (Boolean
, Integer
etc.) and enumerations can be initialized in the declaration of the corresponding field of an entity class, see for example active
and grade
fields in Customer.java.
Additionally, a specific initialization method with a @PostConstruct annotation can be created in the entity class. In this case, any global infrastructure interfaces and beans can be invoked during initialization, see for example the init()
method in Customer.java.