Package org.apache.olingo.odata2.api.edm.provider

Examples of org.apache.olingo.odata2.api.edm.provider.ComplexProperty


        assertEquals("EmployeeId", propertyRef.getName());
      }
      for (Property property : schema.getEntityTypes().get(0).getProperties()) {
        assertEquals(propertyNames[i], property.getName());
        if ("Location".equals(property.getName())) {
          ComplexProperty cProperty = (ComplexProperty) property;
          assertEquals("c_Location", cProperty.getType().getName());
        } else if ("EmployeeName".equals(property.getName())) {
          assertNotNull(property.getCustomizableFeedMappings());
        }
        i++;
      }
View Full Code Here


    ComplexType complexType = new ComplexType().setName("complexType");
    FullQualifiedName complexName = new FullQualifiedName("namespace", "complexType");
    when(edmProvider.getComplexType(complexName)).thenReturn(complexType);

    ComplexProperty propertyComplex = new ComplexProperty().setName("complexProperty").setType(complexName);
    propertyComplexProvider = new EdmComplexPropertyImplProv(edmImplProv, propertyComplex);

  }
View Full Code Here

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

  }
View Full Code Here

  }

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

  }
View Full Code Here

        assertEquals("EmployeeId", propertyRef.getName());
      }
      for (Property property : schema.getEntityTypes().get(0).getProperties()) {
        assertEquals(propertyNames[i], property.getName());
        if ("Location".equals(property.getName())) {
          ComplexProperty cProperty = (ComplexProperty) property;
          assertEquals(NAMESPACE, cProperty.getType().getNamespace());
          assertEquals("c_Location", cProperty.getType().getName());
        } else if ("EmployeeName".equals(property.getName())) {
          assertNotNull(property.getCustomizableFeedMappings());
          assertEquals("SyndicationTitle", property.getCustomizableFeedMappings().getFcTargetPath());
          assertNull(property.getCustomizableFeedMappings().getFcContentKind());
        }
View Full Code Here

        properties.add(new SimpleProperty().setName("Int64").setType(EdmSimpleTypeKind.Int64));
        properties.add(new SimpleProperty().setName("SByte").setType(EdmSimpleTypeKind.SByte));
        properties.add(new SimpleProperty().setName("Single").setType(EdmSimpleTypeKind.Single));
        properties.add(new SimpleProperty().setName("String").setType(EdmSimpleTypeKind.String));
        properties.add(new SimpleProperty().setName("Time").setType(EdmSimpleTypeKind.Time));
        properties.add(new ComplexProperty().setName("Complex").setType(CT_ALL_TYPES));
        return new EntityType().setName(ET_ALL_TYPES.getName()).setProperties(properties);
      } else if (ET_STRING_FACETS.getName().equals(edmFQName.getName())) {
        final List<Property> properties = new ArrayList<Property>();

        properties.add(new SimpleProperty().setName("StringDefaultValue").setType(EdmSimpleTypeKind.String)
View Full Code Here

        properties.add(new SimpleProperty().setName("Int64").setType(EdmSimpleTypeKind.Int64));
        properties.add(new SimpleProperty().setName("SByte").setType(EdmSimpleTypeKind.SByte));
        properties.add(new SimpleProperty().setName("Single").setType(EdmSimpleTypeKind.Single));
        properties.add(new SimpleProperty().setName("String").setType(EdmSimpleTypeKind.String));
        properties.add(new SimpleProperty().setName("Time").setType(EdmSimpleTypeKind.Time));
        properties.add(new ComplexProperty().setName("Address").setType(CT_ADDRESS));
        return new ComplexType().setName(CT_ALL_TYPES.getName()).setAbstract(false).setProperties(properties);
      }
    }

    return null;
View Full Code Here

        properties.add(new SimpleProperty().setName("RoomId").setType(EdmSimpleTypeKind.String)
            .setMapping(new Mapping().setInternalName("getRoom.getId")));
        properties.add(new SimpleProperty().setName("TeamId").setType(EdmSimpleTypeKind.String)
            .setFacets(new Facets().setMaxLength(2))
            .setMapping(new Mapping().setInternalName("getTeam.getId")));
        properties.add(new ComplexProperty().setName("Location").setType(COMPLEX_TYPE_1)
            .setFacets(new Facets().setNullable(false)));
        properties.add(new SimpleProperty().setName("Age").setType(EdmSimpleTypeKind.Int16));
        properties.add(new SimpleProperty().setName("EntryDate").setType(EdmSimpleTypeKind.DateTime)
            .setFacets(new Facets().setNullable(true))
            .setCustomizableFeedMappings(new CustomizableFeedMappings()
View Full Code Here

  @Override
  public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException {
    if (NAMESPACE_1.equals(edmFQName.getNamespace())) {
      if (COMPLEX_TYPE_1.getName().equals(edmFQName.getName())) {
        List<Property> properties = new ArrayList<Property>();
        properties.add(new ComplexProperty().setName("City").setType(COMPLEX_TYPE_2).setFacets(
            new Facets().setNullable(false)));
        properties.add(new SimpleProperty().setName("Country").setType(EdmSimpleTypeKind.String));
        return new ComplexType().setName(COMPLEX_TYPE_1.getName()).setProperties(properties);

      } else if (COMPLEX_TYPE_2.getName().equals(edmFQName.getName())) {
View Full Code Here

                  JPAEdmProperty.this);
            }
            keyView.getBuilder().build();
            complexTypeView.expandEdmComplexType(complexType, properties, currentAttribute.getName());
          } else {
            currentComplexProperty = new ComplexProperty();
            if (isBuildModeComplexType) {
              JPAEdmNameBuilder
                  .build((JPAEdmComplexPropertyView) JPAEdmProperty.this,
                      complexTypeView.getJPAEmbeddableType().getJavaType().getSimpleName());
            } else {
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.edm.provider.ComplexProperty

Copyright © 2018 www.massapicom. 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.