gorm - Is it possible in grails to disable persistence of a domain class dynamically with inheritance -


my question related to/or identical is possible in grails disable persistence of domain class?

i using grails 2.2.1 tried turn off domain class putting static mapwith = "none" gorm creates database table, , calling .save() put entry database. mapwith flag did nothing me. cannot find documentation regarding mapwith flag. there replacement in grails 2?

update on sept 16 code

package test  class person {     string name   static constraints = {   }    static mapping = {     version false     tableperhierarchy false     table 'psn'   } } -------------------  package test  class employer extends person{    static mapwith = 'none'    string title   static constraints = {    }    static mapping = {     version false     tableperhierarchy false     table 'emplyr'   } }  --------- package test  class employee extends person{     string description    static constraints = {   }    static mapping = {     version false     tableperhierarchy false     table 'emplyee'   } } 

i assume employer should not treated domain object. however, when perform, person.list(), sql shown:

hibernate: select this_.id id0_0_, this_.name name0_0_, this_1_.description descript2_1_0_, this_2_.title title2_0_, case when this_1_.id not null 1 when this_2_.id not null 2 when this_.id not null 0 end clazz_0_ psn this_ left outer join emplyee this_1_ on this_.id=this_1_.id left outer join emplyr this_2_ on this_.id=this_2_.id limit ? hibernate: select count(*) y0_ psn this_ left outer join emplyee this_1_ on this_.id=this_1_.id left outer join emplyr this_2_ on this_.id=this_2_.id 

why join emplyr????? purpose eliminate table join when mark "none". doing wrong?


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -