mongodb - What does actually do static mapWith="mongo"? -
static mapwith = "mongo"
i not clear means. according http://grails.github.io/grails-doc/3.0.x/ref/domain%20classes/mapwith.html
mapwith
purpose
the mapwith static property adds ability control if domain class being persisted.
examples
class airport { static mapwith = "none" }
i went through question remove simpledb mapwith meta programming in dev mode
and got idea in grails application,
static mapwith = "mongo"
might using mongodb plugin. still not clear. went through these stackoverflow links :
in grails if want make fields non-persistent can use transient keyword this:
class domainclass { static transients = ['field1', 'field2'] integer field1 integer field2 integer persistentfield1 integer persistentfield2 }
it possible make whole domain class non-persistent using mapwith keyword.
class nonpersistentdomain { ......... .................... ....................... static mapwith = 'none'; }
one can argue better use command object instead of domain has own advantages:
it can accessed using grailsdomainclass. participates while generating ui through scaffolding.
also see link
Comments
Post a Comment