I need to create DB log events for every DB insert but the the sessionfactory is null in my Hibernate interceptor. What's the simplest way for getting a hibernate session in your interception when you are using spring boot.
public class Interceptor extends EmptyInterceptor {
@Autowired
SessionFactory session; //this is null not in the spring scope
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
sessionFactory.getCurrentSession()......