I have a spring web application where I want to block hibernate's insert/delete/update operation if the user in httpSession is a kind of Super user (where user.isSuper() returns true).
I have implemented listener for these events but the problem is that listener is not firing for HQL queries(session.executeUpdate()).
Same problem is with interceptors as well.
Please help.
Try this following code instead of session.executeUpdate() :-
getSessionFactory().getCurrentSession().setFlushMode(FlushMode.NEVER);
getSessionFactory().getCurrentSession().close()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With