Hi, I'm using a spring, jpa & hibernate configuration. My base entity has a boolean column named "inactive" to mark items as deleted/inactive . But it seems I need to constantly activate the filter. I've put this logic of enabling the filter, based on user's role .equals ROLE_ADMIN, into my base service, so whenever a service extending base service cals super.getEntityManager(), I enable the filter for that session. But isn't there a more elegant way of doing this ? I was thinking of using my own custom sessionfactory, but after a brief serch it seemed this wasn't feasible. Can you please help me on this?
Thanks, João Domingues
|