How do I set up a variable within a domain class that is not persistent. I want to be able to write and read to that variable, but I don't want it to be a part of the table.
The way to do this in rails is by setting up a variable with attr_accessor
. Is this possible in Grails? Does anyone know how to do this?
Thanks!
Just add the names of all the transient variables to the transients
list, e.g.
class MyDomain {
static transients = ['nonPersistent', 'nonPersistent2']
Integer nonPersistent
Integer nonPersistent2
Integer persistent
Integer persistent2
}