As we all know, it's possible to use the Hibernate cache for entities used in subsequent queries. My question is, are such cached entities immutable for changes after they putting in cache that way:
a) load the entities from the DB
b) while annotated cacheable, Hibernate put these entities in cache
c) the DAO receives the loaded object
d) the DAO manipulate some attributes of that entity (say decrypt some encrypted fields) but mark that changes as "non-relevant-for-cache"
e) for subsequent queries, the always cached -and manipulated- entities are returned by the Hibernate cache.
I hope this wishlist is not to naive, but I assume, these are quite normal requirements for modern apps based on Spring/Hibernate.