Example usage for org.hibernate.event.spi SaveOrUpdateEventListener interface-usage

List of usage examples for org.hibernate.event.spi SaveOrUpdateEventListener interface-usage

Introduction

In this page you can find the example usage for org.hibernate.event.spi SaveOrUpdateEventListener interface-usage.

Usage

From source file org.egov.infra.config.persistence.event.listener.HibernateEventListener.java

/**
 * This Event listener class sets the audit properties createdBy, createdDate modifiedBy and modifiedDate. It does this by hooking
 * to the pre-update and pre-insert events. The pre-update event was chosen instead of save-update events for setting modified
 * properties to fix a bug where even for object reads the Hibernate objects were getting updated. However, the save-update event
 * is still required for new objects (inserts) as Hibernate checks for not-null constraints before the pre-update event is fired.
 * Due to auto flushing strategy that we use, every transaction commit causes a session.flush to be called. Flush calls cascade of

From source file org.grails.orm.hibernate.support.ClosureEventListener.java

/**
 * <p>Invokes closure events on domain entities such as beforeInsert, beforeUpdate and beforeDelete.
 *
 * <p>Also deals with auto time stamping of domain classes that have properties named 'lastUpdated' and/or 'dateCreated'.
 *
 * @author Lari Hotari