Examples of JPAEdmMapping


Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

    }

    view.getEdmComplexType().setName(edmComplexTypeName);
    ComplexType complexType = view.getEdmComplexType();
    complexType.setName(edmComplexTypeName);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(view.getJPAEmbeddableType().getJavaType());
    complexType.setMapping((Mapping) mapping);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

    } 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);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

      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);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

        .getType();
    FullQualifiedName associationEndTypeTwo = association.getEnd2()
        .getType();

    Attribute<?, ?> jpaAttribute = propertyView.getJPAAttribute();
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    ((Mapping) mapping).setInternalName(jpaAttribute.getName());
    mapping.setJPAType(jpaAttribute.getJavaType());
    navProp.setMapping((Mapping) mapping);

    String jpaEntityTypeName = propertyView.getJPAEdmEntityTypeView()
        .getJPAEntityType().getName();
    JPAEdmMappingModelAccess mappingModelAccess = navPropertyView
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

    return edmComplexType;
  }

  public static JPAEdmMapping mockEdmMapping(final String entityName, final String propertyName,
      final String navigationPropertyName) {
    JPAEdmMapping mapping = new JPAEdmMappingImpl();

    if (propertyName == null && entityName != null) {
      if (entityName.equals(JPATypeMock.ENTITY_NAME)) {
        mapping.setJPAType(JPATypeMock.class);
      } else if (entityName.equals(JPARelatedTypeMock.ENTITY_NAME)) {
        mapping.setJPAType(JPARelatedTypeMock.class);
      } else if (entityName.equals(JPATypeEmbeddableMock.ENTITY_NAME)) {
        mapping.setJPAType(JPATypeEmbeddableMock.class);
      } else if (entityName.equals(JPATypeEmbeddableMock2.ENTITY_NAME)) {
        mapping.setJPAType(JPATypeEmbeddableMock2.class);
      }
    } else if (entityName == null && navigationPropertyName != null) {
      mapping.setJPAType(JPARelatedTypeMock.class);
      mapping.setJPAColumnName(JPATypeMock.NAVIGATION_PROPERTY_X);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MINT)) {
      mapping.setJPAType(int.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MINT);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MSTRING)) {
      mapping.setJPAType(String.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MSTRING);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MDATETIME)) {
      mapping.setJPAType(Calendar.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MDATETIME);
    } else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MLONG)) {
      mapping.setJPAType(long.class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MLONG);
    } else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MDOUBLE)) {
      mapping.setJPAType(double.class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MDOUBLE);
    } else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MBYTE)) {
      mapping.setJPAType(byte.class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MBYTE);
    } else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MBYTEARRAY)) {
      mapping.setJPAType(byte[].class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MBYTEARRAY);
    } else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT)) {
      mapping.setJPAType(Short.TYPE);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT);
    } else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT)) {
      mapping.setJPAType(Float.TYPE);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT);
    } else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID)) {
      mapping.setJPAType(UUID.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID);
    } else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE)) {
      mapping.setJPAType(JPATypeEmbeddableMock2.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE)) {
      mapping.setJPAType(JPATypeEmbeddableMock.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE);
    }
    return mapping;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

  private static List<Property> createComplexTypePropertiesTwo() {
    List<Property> properties = new ArrayList<Property>();
    SimpleProperty property = new SimpleProperty();
    property.setName("SoId");
    property.setType(EdmSimpleTypeKind.Int64);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("Sales_Order_Id");
    ((Mapping) mapping).setInternalName("SalesOrderItemKey.SoId");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    property = new SimpleProperty();
    property.setName("LiId");
    property.setType(EdmSimpleTypeKind.Int64);
    mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("Sales_Order_Item_Id");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    return properties;

  }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

  private static List<Property> createComplexTypePropertiesOne() {
    List<Property> properties = new ArrayList<Property>();
    SimpleProperty property = new SimpleProperty();
    property.setName("StreetName");
    property.setType(EdmSimpleTypeKind.String);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("STREET_NAME");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    property = new SimpleProperty();
    property.setName("City");
    property.setType(EdmSimpleTypeKind.String);
    mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("CITY");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    return properties;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

    assertEquals(functionImportList.size(), 1);

    FunctionImport functionImport = functionImportList.get(0);
    assertEquals(functionImport.getName(), "method7");
    assertNotNull(functionImport.getMapping());
    JPAEdmMapping mapping = (JPAEdmMapping) functionImport.getMapping();
    assertEquals(JPACustomProcessorMock.class, mapping.getJPAType());

    ReturnType returnType = functionImport.getReturnType();
    assertNotNull(returnType);
    assertEquals(EdmMultiplicity.ONE, returnType.getMultiplicity());
    assertEquals(returnType.getTypeName().toString(), ODataJPAContextMock.PERSISTENCE_UNIT_NAME + "."
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

        Object[] args = new Object[edmArguements.size()];
        int i = 0;
        for (String paramName : functionImport.getParameterNames()) {
          EdmLiteral literal = edmArguements.get(paramName);
          EdmParameter parameter = functionImport.getParameter(paramName);
          JPAEdmMapping mapping = (JPAEdmMapping) parameter.getMapping();
          args[i] = convertArguement(literal, parameter.getFacets(), mapping.getJPAType());
          i++;
        }
        return args;
      }
View Full Code Here

Examples of org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping

          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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.