How can I create a dynamic domain class in Grails

◇◆丶佛笑我妖孽 提交于 2019-12-23 15:01:09

问题


How can I create a dynamic domain class in Grails.

Let's say I want to create a new domain class whose class name and properties is known in the run-time. How to create it and persist it in Grails?

Many thanks,


回答1:


There's a plugin for that: http://www.grails.org/plugin/dynamic-domain-class




回答2:


the plugin seems to be abandoned, and in the google group of the project the deveoper say that there is some important issue and he said we can't using it in production, and there is no evolution since 2011, I hope that the founder of the idea Burt Beckwith can help us to continue this plugin, because it is really an interesting thing, there is too much possiblity behind the scene.




回答3:


I'm working to get this to work on grails 2.4.4, I'm very close at getting it to work, only need to make a new instance of sessionfactory to work :)



来源:https://stackoverflow.com/questions/7447048/how-can-i-create-a-dynamic-domain-class-in-grails

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