问题
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