public class TopiaHibernateEventListener extends Object implements org.hibernate.event.spi.PreInsertEventListener, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.event.spi.PreLoadEventListener, org.hibernate.event.spi.PostLoadEventListener, org.hibernate.event.spi.PreUpdateEventListener, org.hibernate.event.spi.PostUpdateEventListener, org.hibernate.event.spi.PreDeleteEventListener, org.hibernate.event.spi.PostDeleteEventListener, org.hibernate.event.spi.SaveOrUpdateEventListener
| Modifier and Type | Field and Description |
|---|---|
protected TopiaHibernateSessionRegistry |
registry |
| Constructor and Description |
|---|
TopiaHibernateEventListener(TopiaHibernateSessionRegistry registry) |
| Modifier and Type | Method and Description |
|---|---|
static void |
attachContext(Object entity,
TopiaDaoSupplier daoSupplier,
TopiaFiresSupport firesSupport)
Method to enrich an entity if possible with the daoSupplier or firesSupport instances
|
protected TopiaPersistenceContext |
getContext(org.hibernate.event.spi.AbstractEvent event)
Look for the TopiaPersistenceContext based on the given Hibernate session
|
void |
onPostDelete(org.hibernate.event.spi.PostDeleteEvent event) |
void |
onPostInsert(org.hibernate.event.spi.PostInsertEvent event) |
void |
onPostLoad(org.hibernate.event.spi.PostLoadEvent event) |
void |
onPostUpdate(org.hibernate.event.spi.PostUpdateEvent event) |
boolean |
onPreDelete(org.hibernate.event.spi.PreDeleteEvent event) |
boolean |
onPreInsert(org.hibernate.event.spi.PreInsertEvent event) |
void |
onPreLoad(org.hibernate.event.spi.PreLoadEvent event) |
boolean |
onPreUpdate(org.hibernate.event.spi.PreUpdateEvent event) |
void |
onSaveOrUpdate(org.hibernate.event.spi.SaveOrUpdateEvent event) |
boolean |
requiresPostCommitHanding(org.hibernate.persister.entity.EntityPersister persister) |
protected TopiaHibernateSessionRegistry registry
public TopiaHibernateEventListener(TopiaHibernateSessionRegistry registry)
protected TopiaPersistenceContext getContext(org.hibernate.event.spi.AbstractEvent event)
event - the Hibernate event that contains the Session to usepublic static void attachContext(Object entity, TopiaDaoSupplier daoSupplier, TopiaFiresSupport firesSupport)
entity - the entity to enrichdaoSupplier - the TopiaDaoSupplier instancefiresSupport - the TopiaFiresSupport instancepublic boolean onPreInsert(org.hibernate.event.spi.PreInsertEvent event)
onPreInsert in interface org.hibernate.event.spi.PreInsertEventListenerpublic void onPostInsert(org.hibernate.event.spi.PostInsertEvent event)
onPostInsert in interface org.hibernate.event.spi.PostInsertEventListenerpublic boolean requiresPostCommitHanding(org.hibernate.persister.entity.EntityPersister persister)
requiresPostCommitHanding in interface org.hibernate.event.spi.PostDeleteEventListenerrequiresPostCommitHanding in interface org.hibernate.event.spi.PostInsertEventListenerrequiresPostCommitHanding in interface org.hibernate.event.spi.PostUpdateEventListenerpublic void onPreLoad(org.hibernate.event.spi.PreLoadEvent event)
onPreLoad in interface org.hibernate.event.spi.PreLoadEventListenerpublic void onPostLoad(org.hibernate.event.spi.PostLoadEvent event)
onPostLoad in interface org.hibernate.event.spi.PostLoadEventListenerpublic boolean onPreUpdate(org.hibernate.event.spi.PreUpdateEvent event)
onPreUpdate in interface org.hibernate.event.spi.PreUpdateEventListenerpublic void onPostUpdate(org.hibernate.event.spi.PostUpdateEvent event)
onPostUpdate in interface org.hibernate.event.spi.PostUpdateEventListenerpublic boolean onPreDelete(org.hibernate.event.spi.PreDeleteEvent event)
onPreDelete in interface org.hibernate.event.spi.PreDeleteEventListenerpublic void onPostDelete(org.hibernate.event.spi.PostDeleteEvent event)
onPostDelete in interface org.hibernate.event.spi.PostDeleteEventListenerpublic void onSaveOrUpdate(org.hibernate.event.spi.SaveOrUpdateEvent event)
throws org.hibernate.HibernateException
onSaveOrUpdate in interface org.hibernate.event.spi.SaveOrUpdateEventListenerorg.hibernate.HibernateExceptionCopyright © 2004–2017 CodeLutin. All rights reserved.