...
Code Block |
---|
entity.getBelongsToField(PluginNameFields.ORDER); |
or even better:
Code Block |
---|
import static com.qcadoo.mes.pluginName.constants.PluginNameFields;
entity.getBelongstoField(ORDER); |
I know it's something new, and refactoring the whole system will be a horror. Let's just use it from now on, ok?You should avoid static importing such constants or you loose their namespace and the probability to make mistake increase dramatically.
It is important especially for field names, which often has the same (or at least very similar) names.
Java enums
For every enum field of a model we create, we should create corresponding Java enum in constants package.
...