private FunctionImport readFunctionImport(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_FUNCTION_IMPORT); FunctionImport function = new FunctionImport(); List<FunctionImportParameter> functionParameters = new ArrayList<FunctionImportParameter>(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>();
private FunctionImport readFunctionImport(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_FUNCTION_IMPORT); FunctionImport function = new FunctionImport(); List<FunctionImportParameter> functionParameters = new ArrayList<FunctionImportParameter>(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>();
private FunctionImport readFunctionImport(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_FUNCTION_IMPORT); FunctionImport function = new FunctionImport(); List<FunctionImportParameter> functionParameters = new ArrayList<FunctionImportParameter>(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>();
private FunctionImport buildEdmFunctionImport(final Method method, final EdmFunctionImport edmAnnotationFunctionImport) throws ODataJPAModelException { if (edmAnnotationFunctionImport != null && edmAnnotationFunctionImport.returnType() != null) { FunctionImport functionImport = new FunctionImport(); if ("".equals(edmAnnotationFunctionImport.name())) { functionImport.setName(method.getName()); } else { functionImport.setName(edmAnnotationFunctionImport.name()); } JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(method.getName()); mapping.setJPAType(method.getDeclaringClass()); functionImport.setMapping((Mapping) mapping); functionImport.setHttpMethod(edmAnnotationFunctionImport.httpMethod().name().toString()); buildEdmReturnType(functionImport, method, edmAnnotationFunctionImport); buildEdmParameter(functionImport, method); return functionImport; } return null; }
private FunctionImport buildEdmFunctionImport(final Method method, final EdmFunctionImport edmAnnotationFunctionImport) throws ODataJPAModelException { if (edmAnnotationFunctionImport != null && edmAnnotationFunctionImport.returnType() != null) { FunctionImport functionImport = new FunctionImport(); if ("".equals(edmAnnotationFunctionImport.name())) { functionImport.setName(method.getName()); } else { functionImport.setName(edmAnnotationFunctionImport.name()); } JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(method.getName()); mapping.setJPAType(method.getDeclaringClass()); functionImport.setMapping((Mapping) mapping); functionImport.setHttpMethod(edmAnnotationFunctionImport.httpMethod().name().toString()); buildEdmReturnType(functionImport, method, edmAnnotationFunctionImport); buildEdmParameter(functionImport, method); return functionImport; } return null; }
private FunctionImport clone(FunctionImport functionImport) { if (functionImport == null) { return null; } FunctionImport newFunctionImport = new FunctionImport(); newFunctionImport.setAnnotationAttributes(functionImport .getAnnotationAttributes()); newFunctionImport.setAnnotationElements(functionImport .getAnnotationElements()); newFunctionImport.setDocumentation(functionImport.getDocumentation()); newFunctionImport.setEntitySet(functionImport.getEntitySet()); newFunctionImport.setHttpMethod(functionImport.getHttpMethod()); newFunctionImport.setMapping(functionImport.getMapping()); newFunctionImport.setName(functionImport.getName()); newFunctionImport.setParameters(functionImport.getParameters()); newFunctionImport.setReturnType(clone(functionImport.getReturnType())); return newFunctionImport; }