When using the Grails MongoDB GORM Plugin (v 1.0.0.GA) standalone (i.e. WITHOUT the Hibernate jars), are the listener events supposed to work?
I've got domain classes with afterInsert, afterUpdate, etc but the event either doesn't fire or the methods are just not getting called.
I'm not seeing any specific guidance on this in the plugin docs. Does anyone know what's supposed to happen? Thanks.
Answering my own question for the benefit of others who may find it:
Apparently, when using MongoDB/GORM without Hibernate, GORM finds the event listeners by looking for the method signature on your domain object class. A closure won't do work (despite the fact that it will work when using Hibernate).
Thus, you cannot use a pattern like this:
class A {
int blah
String foo
def afterInsert = { ... }
}
Instead, do this:
class A {
int blah
String foo
def afterInsert() { ... }
}