In grails 2.0.4, I have a domain class as follows:
class Foo { String pres String temp static transients = ['temp'] def beforeInsert = { println "pres: ${pres}" println "temp: ${temp}" } }
In BootStrap.groovy:
def f1 = new Foo(pres: "p1", temp: "t1") f1.save() def f2 = new Foo(pres: "p2") f2.temp = "t2" f2.save()
Then grails run-app, I got:
pres: p1 temp: null pres: p2 temp: t2
What is the difference between f1 and f2, cannot initialize the transition element?
source share