Persistence provider for Java that supports final fields
- by naeron84
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?