} else if (returnType == Identity.class) {
return new Identity((Number) result);
} else if (Number.class.isAssignableFrom(returnType)) {
return result;
} else {
throw new DataRetrievalFailureException(
"The generated key is not of a supported numeric type. " + "Unable to cast ["
+ result.getClass().getName() + "] to [" + Number.class.getName() + "]");
}
}