use of com.gmoon.hibernateenvers.global.envers.listener.RevisionHistoryEventListener in project toy by gmoon92.
the class JpaConfig method init.
@PostConstruct
public void init() {
SessionFactoryImpl sessionFactory = entityManagerFactory.unwrap(SessionFactoryImpl.class);
EventListenerRegistry registry = sessionFactory.getServiceRegistry().getService(EventListenerRegistry.class);
EntityManager entityManager = entityManagerFactory.createEntityManager();
RevisionHistoryEventListener revisionHistoryEventListener = new RevisionHistoryEventListener(entityManager);
registry.appendListeners(EventType.POST_COMMIT_INSERT, revisionHistoryEventListener);
}
use of com.gmoon.hibernateenvers.global.envers.listener.RevisionHistoryEventListener in project toy by gmoon92.
the class JPAEventListenerIntegrator method integrate.
@Override
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
final EventListenerRegistry listenerRegistry = serviceRegistry.getService(EventListenerRegistry.class);
EntityManager em = sessionFactory.createEntityManager();
listenerRegistry.appendListeners(EventType.POST_COMMIT_INSERT, new RevisionHistoryEventListener(em));
}
use of com.gmoon.hibernateenvers.global.envers.listener.RevisionHistoryEventListener in project Toy by gmoon92.
the class JpaConfig method init.
@PostConstruct
public void init() {
SessionFactoryImpl sessionFactory = entityManagerFactory.unwrap(SessionFactoryImpl.class);
EventListenerRegistry registry = sessionFactory.getServiceRegistry().getService(EventListenerRegistry.class);
EntityManager entityManager = entityManagerFactory.createEntityManager();
RevisionHistoryEventListener revisionHistoryEventListener = new RevisionHistoryEventListener(entityManager);
registry.appendListeners(EventType.POST_COMMIT_INSERT, revisionHistoryEventListener);
}
use of com.gmoon.hibernateenvers.global.envers.listener.RevisionHistoryEventListener in project Toy by gmoon92.
the class JPAEventListenerIntegrator method integrate.
@Override
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
final EventListenerRegistry listenerRegistry = serviceRegistry.getService(EventListenerRegistry.class);
EntityManager em = sessionFactory.createEntityManager();
listenerRegistry.appendListeners(EventType.POST_COMMIT_INSERT, new RevisionHistoryEventListener(em));
}
Aggregations