I'm very new to Java but I've been developing a habit to use final wherever possible declaring immutability which i think is a good thing. (Consider f#)
I've read that JPA does not support final fields. Hibernate, TopLink? I'm not sure about these but i prefer JPA for now.
Is that even possible theoretically - let's say through reflection - to modify final fields after creation? My guess would be... NO :)
What would be certainly possible for a persistence solution is to support constructors with parameters. At least i see no reason that would make this impossible. Mapping would be a little tricky i guess. This is an alternative solution.
Suggestions?
EDIT: I'm not familiar with the exact definition for immutable so i used it in this post intuitively. Declaring Immutability here means declaring that a field cannot be changed. Sorry for the misunderstanding.