1

How can a Grails 2.5.3 domain class have a Collection property of embedded objects?

class Embedded {
    String a
    String b
}

@grails.persistence.Entity
class Domain {
    List<Embedded> embeddedList
}
XDR
  • 4,070
  • 3
  • 30
  • 54
  • If the embedded objects are not persistence entities, which I assume they are not, then they should be defined as command objects. One way of doing that is to create DomainCommand with embedded objects collection. – Armaiti Jan 28 '16 at 16:10
  • @Aramiti The embedded objects are not domain objects, but they should be persisted. There is no need, however, for Embedded to have a publicly available ID, or to have CRUD methods directly for Embedded. The CRUD for Embedded should be performed via Domain. So it seems like your suggestion is not applicable in this case. – XDR Jan 28 '16 at 19:01

0 Answers0