我们在没有休眠的 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 中是否支持或有一些替代方法。