Grails: Error while applying criteria Query -
i applying criteria query find sum of columns , save result in long format. when there data in table, working fine, in case no match records found, following error thrown:
cannot cast object 'null' class 'null' class 'long'**
my code is:
long referralpoints = referraldetail.createcriteria().get { eq('referredby', user) projections { sum('referralpoints') } }
use long instead of long. primitives cannot null.
Comments
Post a Comment