Grails

GORM after events

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1-beta1
  • Component/s: Persistence
  • Labels:
    None

Description

I've been reading about GORM events, and beforeInsert is working as expected but there doesn't seem to be an afterInsert event. It would be very handy to have one for creating default associations once an object has been saved.

Activity

Hide
Shawn Hartsock added a comment -

The Hibernate events plugin seems to provide this already.

http://docs.codehaus.org/display/GRAILS/Hibernate+Events+Plugin

Is this something better left as a plugin or incorporated into GORM?

Show
Shawn Hartsock added a comment - The Hibernate events plugin seems to provide this already. http://docs.codehaus.org/display/GRAILS/Hibernate+Events+Plugin Is this something better left as a plugin or incorporated into GORM?
Hide
Ricardo J. Méndez added a comment -

It does indeed - I've been using it. I do think this should be part of the code GORM implementation, since some of this is already there. Conceptually, it makes little sense to have some events within GORM and some as plugins.

Show
Ricardo J. Méndez added a comment - It does indeed - I've been using it. I do think this should be part of the code GORM implementation, since some of this is already there. Conceptually, it makes little sense to have some events within GORM and some as plugins.
Hide
Dustin Whitney added a comment -

I've found that the hibernate-events plugin breaks "grails console"

Show
Dustin Whitney added a comment - I've found that the hibernate-events plugin breaks "grails console"
Hide
Matthew Taylor added a comment -

I have had problems using the hibernate events plugin, so I don't want to incorporate it as-is into Grails, but I agree that all those event catchers should exist in Grails.

Show
Matthew Taylor added a comment - I have had problems using the hibernate events plugin, so I don't want to incorporate it as-is into Grails, but I agree that all those event catchers should exist in Grails.
Hide
Graeme Rocher added a comment -

Grails 1.1 now supports all of the events from the hibernate events plugin

Show
Graeme Rocher added a comment - Grails 1.1 now supports all of the events from the hibernate events plugin

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: