对多个类使用 grails 导出插件
grails 导出插件旨在导出单个域类。有没有办法使用 Grails 导出插件导出 hasMany 域类的层次结构。我可以进行连接来创建瞬态类或命令对象类吗?
例如:
class Author {
String name
static hasMany = [books:Book]
}
class Book {
String name
static hasMany = [chapters:Chapter]
}
class Chapter {
String name
Integer pages
}
要创建每行具有以下内容的导出:
Author name, Book name, Chapter Name, pages
The grails export plugin is designed to export a single domain class. Is there a way to use the Grails export plugin to export a hierarchy of hasMany domain classes. Could I do a join that creates a transient class or command object class.
For instance:
class Author {
String name
static hasMany = [books:Book]
}
class Book {
String name
static hasMany = [chapters:Chapter]
}
class Chapter {
String name
Integer pages
}
To create an export with each row having:
Author name, Book name, Chapter Name, pages
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我成功地使用了此处描述的扩展记录方法
I successfully used the expanded record approach described here