My Eclipse automatically performs a series of code cleanup actions when I save a Java file, including the addition of finalto fields private.
Will there be a conflict with the ability of Hibernate to embed object properties in private fields?
@Id
private final Long id = null;
Should I disable this save action?
Update: I tested the application and also watched it using the debugger, and Hibernate really reset the "final" field, so everything continues to work fine. But is it guaranteed? For example, are there no VM or compiler optimizations that rely on a field that is truly final. They will probably break. On the other hand, the ability to set fields privatethrough reflection seems to be a supported scenario, so does the same thinking probably apply to final?
source
share