Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.orm.hibernate.support
[Java] Class ClosureEventListener

    java.lang.Object
      org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventListener

All Implemented Interfaces:
  org.hibernate.event.SaveOrUpdateEventListener, org.hibernate.event.PreLoadEventListener, org.hibernate.event.PostLoadEventListener, org.hibernate.event.PostInsertEventListener, org.hibernate.event.PostUpdateEventListener, org.hibernate.event.PostDeleteEventListener, org.hibernate.event.PreDeleteEventListener, org.hibernate.event.PreUpdateEventListener

    @SuppressWarnings({"rawtypes", "unchecked", "serial"})
    public class ClosureEventListener
    extends java.lang.Object

Invokes closure events on domain entities such as beforeInsert, beforeUpdate and beforeDelete.

Also deals with auto time stamping of domain classes that have properties named 'lastUpdated' and/or 'dateCreated'.

Authors:
  Lari Hotari

Since:
  1.3.5

Constructor Summary
`ClosureEventListener(java.lang.Class domainClazz, boolean failOnError, java.util.List failOnErrorPackages)`

Method Summary
`void` | `onPostDelete(org.hibernate.event.PostDeleteEvent event)`
`void` | `onPostInsert(org.hibernate.event.PostInsertEvent event)`
`void` | `onPostLoad(org.hibernate.event.PostLoadEvent event)`
`void` | `onPostUpdate(org.hibernate.event.PostUpdateEvent event)`
`boolean` | `onPreDelete(org.hibernate.event.PreDeleteEvent event)`
`boolean` | `onPreInsert(org.hibernate.event.PreInsertEvent event)`
`void` | `onPreLoad(org.hibernate.event.PreLoadEvent event)`
`boolean` | `onPreUpdate(org.hibernate.event.PreUpdateEvent event)`
`void` | `onSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent event)`
`void` | `onValidate(org.grails.datastore.mapping.engine.event.ValidationEvent event)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Constructor Detail

### ClosureEventListener

    public ClosureEventListener(java.lang.Class domainClazz, boolean failOnError, java.util.List failOnErrorPackages)

Method Detail

### onPostDelete

    public void onPostDelete(org.hibernate.event.PostDeleteEvent event)

### onPostInsert

    public void onPostInsert(org.hibernate.event.PostInsertEvent event)

### onPostLoad

    public void onPostLoad(org.hibernate.event.PostLoadEvent event)

### onPostUpdate

    public void onPostUpdate(org.hibernate.event.PostUpdateEvent event)

### onPreDelete

    public boolean onPreDelete(org.hibernate.event.PreDeleteEvent event)

### onPreInsert

    public boolean onPreInsert(org.hibernate.event.PreInsertEvent event)

### onPreLoad

    public void onPreLoad(org.hibernate.event.PreLoadEvent event)

### onPreUpdate

    public boolean onPreUpdate(org.hibernate.event.PreUpdateEvent event)

### onSaveOrUpdate

    public void onSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent event)

### onValidate

    public void onValidate(org.grails.datastore.mapping.engine.event.ValidationEvent event)

Groovy Documentation