JSON序列化嵌套域类

时间:2014-11-09 15:13:32

标签: json mongodb grails gorm

我无法使用自动JSON序列化嵌套域类。 嵌套类未嵌入。 Grails是2.4.3。 只有序列化字段的手动构建映射才有效。

使用lazy false标记域字段并不起作用。

 class Search {
   static mapping = {       
          portal lazy: false
   }
   String id
   Portal portal
}

参数 grails.converters.json.default.deep 也会被忽略

此外,我尝试插件":marshallers:0.6"。

 class Search {
   static marshalling = {       
          deep 'portal'
   }
   String id
   Portal portal
 }

展示了嵌套类的所有字段,但大多数字段都具有空值,例外字段是class和id。

Grails get child domain objects

0 个答案:

没有答案
相关问题