if (!(expr instanceof NumericExpression))
{
// JDO2 spec [14.6.9] : SUM is invalid on non-numeric types
throw new JPOXUserException(LOCALISER.msg("037011", "SUM"));
}
JavaTypeMapping sumMapping = expr.getMapping();
if (sumMapping instanceof IntegerMapping || sumMapping instanceof ShortMapping)
{
// Integral types return Long
sumMapping = qs.getStoreManager().getDatastoreAdapter().getMapping(Long.class,
qs.getStoreManager(), qs.getClassLoaderResolver());