开发者

Use grails export plugin for multiple classes

开发者 https://www.devze.com 2023-04-01 13:18 出处:网络
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 tr

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

0

精彩评论

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

关注公众号