How can I access GORM object properties in a GroovyScriptCommand?

妖精的绣舞 提交于 2019-12-12 19:36:21

问题


I used the Grails create-script command to create my own custom script for rendering source code artifacts based on a GORM domain object. I want to generate a command object that contains the properties of the domain object. I see the properties and methods on the GroovyScriptCommand and TemplateRenderer, but I can't tell how to get a reference to the domain object properties or how to render them in my scaffolding templates. I tried forClass(model.fullName) but it says ClassNotFounException. I also tried install-templates, but that command no longer installs templates that render any object properties.

来源:https://stackoverflow.com/questions/35581942/how-can-i-access-gorm-object-properties-in-a-groovyscriptcommand

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!