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 {
Stri开发者_如何学编程ng 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
I successfully used the expanded record approach described here
精彩评论