I want to transfer projection result into List.i'm using following code
testDataList = FunctionalTestCaseData.createCriteria().list(max: pageSize, offset: offset){
eq("functionalTest",fTestcase)
and{
eq("delFlag",0)
}
projections {
property('id')
property('testStep')
property('testData')
property('expectedResult')
property('actualResult')
property('result')
property('functionalTest')
}
resultTransformer = new AliasToBeanResultTransformer(FunctionalTestCaseData)
};
but is doesn't work. its gives me List<Domain>
with null
value.
Below code is work for me.
domainDataList = DomainClass.createCriteria().list(){
resultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP)
projections {
property('id', 'id')
property('title', 'title')
}
};
Note: Use property()
with two param,Otherwise it will return null
.