Grails 给域动态加属性 //ExpandoMetaClass(class,boolean) class为要加属性的域def emc = new ExpandoMetaClass(Resource.class, false )//给Resource加hasPermission 属性emc.hasPermission = trueemc.initialize()//it为一个Resource的实例it.metaClass = emc