How do you configure custom row level security with Hibernate?

I have a bunch of Hibernate entities that are firing off individual “select” queries using built-in transactions within Hibernate. However, I just added row level security using a custom parameter that needs to be set within each transaction.

I could do it in Spring’s Transactional methods, but Hibernate does not seem to work, even if I add Transactional on individual methods.

How can I run a custom “set config variable” query within each transaction started in Hibernate? I tried Interceptors, but can’t get the current session, in afterTransactionBegin method.