immutable « Property « JPA Q&A





1. Synchronization and immutable properties    forum.hibernate.org

If I were to have an immutable property of a class, usually it would be set in the constructor(s) and a getter method written which wouldn't have to be synchronized. There'd be no setter. In hibernate, since setters and getters have to be provided for every persistent property, even if they can be private, does this mean that they have to ...

2. @Immutable annotation for immutable properties    forum.hibernate.org

I am using Hibernate 3.2.5 and I would like to mark some properties of a persisted class as immutable. I want to be able to create new instances of this class and save those values, but once saved I want the setter to throw an exception stating that the property cannot be modified. Is that what the method level annotation @Immutable ...