org.specrunner.hibernate
Class HibernateListener

java.lang.Object
  extended by org.specrunner.hibernate.HibernateListener
All Implemented Interfaces:
Serializable, org.hibernate.event.spi.PostInsertEventListener, org.hibernate.event.spi.PreInsertEventListener

public class HibernateListener
extends Object
implements org.hibernate.event.spi.PreInsertEventListener, org.hibernate.event.spi.PostInsertEventListener

A Hibernate listener to monitor object insertions.

Author:
Thiago Santos
See Also:
Serialized Form

Field Summary
protected  Map<Class<?>,AbstractPluginObject> entities
          Map of objects inserted.
protected  String keyBefore
          Key of object before inclusion.
 
Constructor Summary
HibernateListener(Map<Class<?>,AbstractPluginObject> entities)
          Creates a listener with a entities mapping.
 
Method Summary
 void onPostInsert(org.hibernate.event.spi.PostInsertEvent event)
           
 boolean onPreInsert(org.hibernate.event.spi.PreInsertEvent event)
           
 boolean requiresPostCommitHanding(org.hibernate.persister.entity.EntityPersister persister)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entities

protected Map<Class<?>,AbstractPluginObject> entities
Map of objects inserted.


keyBefore

protected String keyBefore
Key of object before inclusion.

Constructor Detail

HibernateListener

public HibernateListener(Map<Class<?>,AbstractPluginObject> entities)
Creates a listener with a entities mapping.

Parameters:
entities - The entity mapping by type.
Method Detail

onPreInsert

public boolean onPreInsert(org.hibernate.event.spi.PreInsertEvent event)
Specified by:
onPreInsert in interface org.hibernate.event.spi.PreInsertEventListener

onPostInsert

public void onPostInsert(org.hibernate.event.spi.PostInsertEvent event)
Specified by:
onPostInsert in interface org.hibernate.event.spi.PostInsertEventListener

requiresPostCommitHanding

public boolean requiresPostCommitHanding(org.hibernate.persister.entity.EntityPersister persister)
Specified by:
requiresPostCommitHanding in interface org.hibernate.event.spi.PostInsertEventListener


Copyright © 2014. All rights reserved.