@SuppressWarnings("unchecked")
@Override
public List<Object> process(final GetFunctionImportUriInfo uriParserResultView)
throws ODataJPAModelException, ODataJPARuntimeException {
JPAMethodContext jpaMethodContext = JPAMethodContext.createBuilder(
JPQLContextType.FUNCTION, uriParserResultView).build();
List<Object> resultObj = null;
try {
JPAFunction jpaFunction = jpaMethodContext.getJPAFunctionList()
.get(0);
Method method = jpaFunction.getFunction();
Object[] args = jpaFunction.getArguments();
if (uriParserResultView.getFunctionImport().getReturnType()
.getMultiplicity().equals(EdmMultiplicity.MANY)) {
resultObj = (List<Object>) method.invoke(
jpaMethodContext.getEnclosingObject(), args);
} else {
resultObj = new ArrayList<Object>();
Object result = method.invoke(
jpaMethodContext.getEnclosingObject(), args);
resultObj.add(result);
}
} catch (EdmException e) {
throw ODataJPARuntimeException