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; }
public static void build(final JPAEdmComplexPropertyView complexView, final String parentComplexTypeName, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); JPAEdmPropertyView propertyView = ((JPAEdmPropertyView) complexView); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAEmbeddableTypeAttribute(parentComplexTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
public static void build(final JPAEdmComplexPropertyView complexView, final String parentComplexTypeName, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); JPAEdmPropertyView propertyView = ((JPAEdmPropertyView) complexView); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAEmbeddableTypeAttribute(parentComplexTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
public static void build(final JPAEdmComplexPropertyView complexView, final JPAEdmPropertyView propertyView, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String jpaEntityTypeName = propertyView.getJPAEdmEntityTypeView().getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAAttribute(jpaEntityTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } // change for navigation property issue JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
public static void build(final JPAEdmComplexPropertyView complexView, final JPAEdmPropertyView propertyView, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String jpaEntityTypeName = propertyView.getJPAEdmEntityTypeView().getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAAttribute(jpaEntityTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } // change for navigation property issue JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
((Mapping) mapping).setInternalName(jpaAttributeName); view.getEdmSimpleProperty().setMapping((Mapping) mapping);
public static void build(final JPAEdmEntityTypeView view) { EntityType edmEntityType = view.getEdmEntityType(); String jpaEntityName = view.getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess(); String edmEntityTypeName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName); } JPAEdmMapping mapping = new JPAEdmMappingImpl(); mapping.setJPAType(view.getJPAEntityType().getJavaType()); if (edmEntityTypeName == null) { edmEntityTypeName = jpaEntityName; } // Setting the mapping object edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName)); edmEntityType.setName(edmEntityTypeName); }
public static void build(final JPAEdmEntityTypeView view) { EntityType edmEntityType = view.getEdmEntityType(); String jpaEntityName = view.getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess(); String edmEntityTypeName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName); } JPAEdmMapping mapping = new JPAEdmMappingImpl(); mapping.setJPAType(view.getJPAEntityType().getJavaType()); if (edmEntityTypeName == null) { edmEntityTypeName = jpaEntityName; } // Setting the mapping object edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName)); edmEntityType.setName(edmEntityTypeName); }
((Mapping) mapping).setInternalName(jpaAttributeName); view.getEdmSimpleProperty().setMapping((Mapping) mapping);
((Mapping) mapping).setInternalName(jpaAttribute.getName()); mapping.setJPAType(jpaAttribute.getJavaType()); navProp.setMapping((Mapping) mapping);
((Mapping) mapping).setInternalName(jpaAttribute.getName()); mapping.setJPAType(jpaAttribute.getJavaType()); navProp.setMapping((Mapping) mapping);