@Test public void checkReturnsEnumerationTypeAsParameter() throws ODataJPAModelException { final IntermediateJavaFunction act = createFunction(ExampleJavaFunctions.class, "returnEnumerationType"); assertEquals("com.sap.olingo.jpa.AccessRights", act.getEdmItem().getParameters().get(0).getTypeFQN() .getFullQualifiedNameAsString()); JPAParameter param = act.getParameter("arg0"); if (param == null) param = act.getParameter("rights"); assertNotNull(param); assertEquals("com.sap.olingo.jpa.AccessRights", param.getTypeFQN().getFullQualifiedNameAsString()); }
@Override public List<JPAParameter> getParameter() throws ODataJPAModelException { if (parameterList == null) { parameterList = new ArrayList<>(); Class<?>[] types = javaFunction.getParameterTypes(); Parameter[] declairedParameters = javaFunction.getParameters(); for (int i = 0; i < declairedParameters.length; i++) { Parameter declairedParameter = declairedParameters[i]; EdmParameter definedParameter = declairedParameter.getAnnotation(EdmParameter.class); if (definedParameter == null) throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.FUNC_PARAM_ANNOTATION_MISSING, declairedParameter.getName(), javaFunction.getName(), javaFunction .getDeclaringClass().getName()); JPAParameter parameter = new IntermediatFunctionParameter(definedParameter, nameBuilder .buildPropertyName(definedParameter.name()), declairedParameter.getName(), types[i]); parameterList.add(parameter); } } return parameterList; }
IntermediateJavaFunction extends IntermediateFunction implements JPAJavaFunction { @Override public List<JPAParameter> getParameter() throws ODataJPAModelException { if (parameterList == null) { parameterList = new ArrayList<>(); Class<?>[] types = javaFunction.getParameterTypes(); Parameter[] declairedParameters = javaFunction.getParameters(); for (int i = 0; i < declairedParameters.length; i++) { Parameter declairedParameter = declairedParameters[i]; EdmParameter definedParameter = declairedParameter.getAnnotation(EdmParameter.class); if (definedParameter == null) throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.FUNC_PARAM_ANNOTATION_MISSING, declairedParameter.getName(), javaFunction.getName(), javaFunction .getDeclaringClass().getName()); JPAParameter parameter = new IntermediatFunctionParameter(definedParameter, nameBuilder .buildPropertyName(definedParameter.name()), declairedParameter.getName(), types[i]); parameterList.add(parameter); } } return parameterList; } }
IntermediateJavaFunction extends IntermediateFunction implements JPAJavaFunction { @Override public List<JPAParameter> getParameter() throws ODataJPAModelException { if (parameterList == null) { parameterList = new ArrayList<>(); Class<?>[] types = javaFunction.getParameterTypes(); Parameter[] declairedParameters = javaFunction.getParameters(); for (int i = 0; i < declairedParameters.length; i++) { Parameter declairedParameter = declairedParameters[i]; EdmParameter definedParameter = declairedParameter.getAnnotation(EdmParameter.class); if (definedParameter == null) throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.FUNC_PARAM_ANNOTATION_MISSING, declairedParameter.getName(), javaFunction.getName(), javaFunction .getDeclaringClass().getName()); JPAParameter parameter = new IntermediatFunctionParameter(definedParameter, nameBuilder .buildPropertyName(definedParameter.name()), declairedParameter.getName(), types[i]); parameterList.add(parameter); } } return parameterList; } IntermediateJavaFunction(final JPAEdmNameBuilder nameBuilder, final EdmFunction jpaFunction,
      final Method javaFunction, final IntermediateSchema schema); }
IntermediateJavaFunction extends IntermediateFunction implements JPAJavaFunction { @Override public List<JPAParameter> getParameter() throws ODataJPAModelException { if (parameterList == null) { parameterList = new ArrayList<>(); Class<?>[] types = javaFunction.getParameterTypes(); Parameter[] declairedParameters = javaFunction.getParameters(); for (int i = 0; i < declairedParameters.length; i++) { Parameter declairedParameter = declairedParameters[i]; EdmParameter definedParameter = declairedParameter.getAnnotation(EdmParameter.class); if (definedParameter == null) throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.FUNC_PARAM_ANNOTATION_MISSING, declairedParameter.getName(), javaFunction.getName(), javaFunction .getDeclaringClass().getName()); JPAParameter parameter = new IntermediatFunctionParameter(definedParameter, nameBuilder .buildPropertyName(definedParameter.name()), declairedParameter.getName(), types[i]); parameterList.add(parameter); } } return parameterList; } IntermediateJavaFunction(final JPAEdmNameBuilder nameBuilder, final EdmFunction jpaFunction,
      final Method javaFunction, final IntermediateSchema schema); @Override Constructor<?> getConstructor(); @Override EdmFunctionType getFunctionType(); @Override Method getMethod(); @Override List<JPAParameter> getParameter(); @Override JPAParameter getParameter(String internalName); @Override JPAOperationResultParameter getResultParameter(); @Override CsdlReturnType getReturnType(); }
IntermediateJavaFunction extends IntermediateFunction implements JPAJavaFunction { @Override public List<JPAParameter> getParameter() throws ODataJPAModelException { if (parameterList == null) { parameterList = new ArrayList<>(); Class<?>[] types = javaFunction.getParameterTypes(); Parameter[] declairedParameters = javaFunction.getParameters(); for (int i = 0; i < declairedParameters.length; i++) { Parameter declairedParameter = declairedParameters[i]; EdmParameter definedParameter = declairedParameter.getAnnotation(EdmParameter.class); if (definedParameter == null) throw new ODataJPAModelException(ODataJPAModelException.MessageKeys.FUNC_PARAM_ANNOTATION_MISSING, declairedParameter.getName(), javaFunction.getName(), javaFunction .getDeclaringClass().getName()); JPAParameter parameter = new IntermediatFunctionParameter(definedParameter, nameBuilder .buildPropertyName(definedParameter.name()), declairedParameter.getName(), types[i]); parameterList.add(parameter); } } return parameterList; } IntermediateJavaFunction(final JPAEdmNameBuilder nameBuilder, final EdmFunction jpaFunction,
      final Method javaFunction, final IntermediateSchema schema); @Override Constructor<?> getConstructor(); @Override EdmFunctionType getFunctionType(); @Override Method getMethod(); @Override List<JPAParameter> getParameter(); @Override JPAParameter getParameter(String internalName); @Override JPAOperationResultParameter getResultParameter(); @Override CsdlReturnType getReturnType();  }