开发者

Generate XML Schema for Domain Classes in Grails

Could you please suggest a service or plugin开发者_开发百科 which generate the corresponding XML Schema for a given Domaing Class or for all Domain Classes of Grails project.


This plugin does exactly what you're asking.

http://grails.org/plugin/domain-schemagen


You just need to type the following command shell from your project root directory:

> grails schema-export

See schema-export documentation for further details

It will generate a DDL file.

From there, you need to convert it into XML (if you really want XML).


I recommend using a database migration to control all the schema generation and to manage future changes. We use Liquibase, it's very easy to use and flexible and there is already a Grails plug in for it. All the changes in Liquibase are managed in XML format.

Also, if I am not mistaken database migrations are going to be integrated in Grails core for version 1.4 so you will be able to use schema migrations without having to install any plug in and I think with this you would be able to manage your changes using DSL as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜