【发布时间】:2014-05-13 06:13:18
【问题描述】:
我们在没有休眠的 Grails 2.3.5 应用程序中使用 MongoDB。有什么方法可以使用resultTransformer 将属性投影转换为Map,就像在休眠中一样。
例如:
User.withCriteria {
resultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP)
projections {
property('name', 'fullName')
}
def now = new Date()
between('joinDate', now-365, now)
}
这在休眠状态下有效。 Grails MongoDB 是否支持此功能或有其他替代方法。
【问题讨论】:
标签: grails grails-2.3