I would like to know how the code below affects database creation and data access in Java playframework
public Boolean isactive;
and
Boolean isactive;
I would like to know how the code below affects database creation and data access in Java playframework
public Boolean isactive;
and
Boolean isactive;
To understand how this difference affects data access, you must understand how to control access to fields of a class:
At the member level, you can also use the public modifier or no modifier (package-private) just as with top-level classes, and with the same meaning. For members, there are two additional access modifiers: private and protected. The private modifier specifies that the member can only be accessed in its own class. The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.
And then, there is the page linked by @PiNg2Eiw that explains how Play Enhancer uses these declarations to automatically add setters and getters:
The enhancer looks for all fields on Java classes that:
- are public
- are non static
- are non final
For each of those fields, it will generate a getter and a setter if they don’t already exist. If you wish to provide a custom getter or setter for a field, this can be done by just writing it, the Play enhancer will simply skip the generation of the getter or setter if it already exists.
Also, database creation is heavily dependent on how you map your model classes. See the following docs: