I use Spring Data CrudRepository
and I want to use Hibernate Filters feature (in my case for soft deletion) with it. To activate filter I need access to Hibernate session (it seems there is no way to enable filters by default in Hibernate - HHH-3815). The problem is that I don't have access to Hibernate session since Spring CrudRepository
is just an interface.
I was wondering if there is some standard way to make these technologies work together?
Or the only option is aspect (pointcuts something like * org.hibernate.SessionFactory.openSession(..)
or @annotation(org.springframework.transaction.annotation.Transactional)
?