I load from cache, I don’t refresh it and I cannot refresh it because I need the entity from the transaction. I think anyway the annotation can be confusing, because I think the Where condition is always true when retrieving data from repository (even if Hibernate read it from cache)
I don’t know @Filter annotation but reading the doc it can be useful, the only drawback is I have to enable the filter calling it by name and currently I have a lot of occurrences of Where annotation.
You’re welcome. I don’t know if the @Filter annotation will help you here since it also translates to an SQL filtering on the SQL clause. But if you load an entity, you are responsible for making sure the in-memory changes are in sync prior to flushing them to the DB.