I have a hibernate entity in my play! project that is backed by a mysql database and queries using JPA.
What I now want to do is to add an "archive" facility to my app which deletes this entity as far as the user is concerned.
However there are still other entities which will reference it so I cannot do a delete on the entity , plus I want the ability to restore it from the archive.
However I do not want it to appear in lists or searches by default but of course still need the ability to access the data there on some occasions such as when the user is examining an item that references it.
There are a number of queries that reference the entity and I could add a WHERE clause to each of these but I am also using some of the built in query methods such as findAll().
I think it would be a lot cleaner if I could somehow add the where clause by default.
Is there any way to do this?