Examples of EdmComplexType


Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

    assertEquals("EntityType1", entityTypeWithAlias.getName());
    EdmEntityType entityType = edm.getEntityType("EntityType1Ns", "EntityType1");
    assertEquals("EntityType1", entityType.getName());
    assertEquals(entityType, entityTypeWithAlias);

    EdmComplexType complexTypeWithAlias = edm.getComplexType("ct1", "ComplexType1");
    assertEquals("ComplexType1", complexTypeWithAlias.getName());
    EdmComplexType complexType = edm.getComplexType("ComplexType1Ns", "ComplexType1");
    assertEquals("ComplexType1", complexType.getName());
    assertEquals(complexType, complexTypeWithAlias);

    EdmAssociation associationWithAlias = edm.getAssociation("at1", "Association1");
    assertEquals("Association1", associationWithAlias.getName());
    EdmAssociation association = edm.getAssociation("Association1Ns", "Association1");
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

    assertEquals(entityType, entityTypeWithAlias);
  }

  @Test
  public void testComplexType() throws EdmException {
    EdmComplexType complexType = edm.getComplexType("ComplexType1Ns", "ComplexType1");
    assertEquals("ComplexType1", complexType.getName());

    EdmComplexType complexTypeWithAlias = edm.getComplexType("ct1", "ComplexType1");
    assertEquals("ComplexType1", complexTypeWithAlias.getName());

    assertEquals(complexType, complexTypeWithAlias);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

    when(employeeEntryDateFacets.isNullable()).thenReturn(Boolean.TRUE);
    when(employeeEntryDateProperty.getFacets()).thenReturn(employeeEntryDateFacets);

    createProperty("ImageUrl", EdmSimpleTypeKind.String, employeeType);

    final EdmComplexType locationComplexType = mock(EdmComplexType.class);
    when(locationComplexType.getKind()).thenReturn(EdmTypeKind.COMPLEX);
    when(locationComplexType.getName()).thenReturn("c_Location");
    when(locationComplexType.getNamespace()).thenReturn("RefScenario");
    when(locationComplexType.getPropertyNames()).thenReturn(Arrays.asList("City", "Country"));

    final EdmProperty locationComplexProperty = mock(EdmProperty.class);
    when(locationComplexProperty.getType()).thenReturn(locationComplexType);
    when(locationComplexProperty.getName()).thenReturn("Location");
    when(employeeType.getProperty("Location")).thenReturn(locationComplexProperty);
    createProperty("Country", EdmSimpleTypeKind.String, locationComplexType);

    final EdmComplexType cityComplexType = mock(EdmComplexType.class);
    when(cityComplexType.getKind()).thenReturn(EdmTypeKind.COMPLEX);
    when(cityComplexType.getName()).thenReturn("c_City");
    when(cityComplexType.getNamespace()).thenReturn("RefScenario");
    when(cityComplexType.getPropertyNames()).thenReturn(Arrays.asList("PostalCode", "CityName"));

    EdmProperty cityProperty = mock(EdmProperty.class);
    when(cityProperty.getType()).thenReturn(cityComplexType);
    when(cityProperty.getName()).thenReturn("City");
    when(locationComplexType.getProperty("City")).thenReturn(cityProperty);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

      return edmEntityType;
    }

    @Override
    protected EdmComplexType createComplexType(final FullQualifiedName fqName) throws ODataException {
      EdmComplexType edmComplexType = mock(EdmComplexType.class);
      when(edmComplexType.getNamespace()).thenReturn(fqName.getNamespace());
      when(edmComplexType.getName()).thenReturn(fqName.getName());
      return edmComplexType;
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

      EntityProviderException {
    EdmType type = property.getType();
    if (type instanceof EdmSimpleType) {
      return EntityPropertyInfo.create(property);
    } else if (type instanceof EdmComplexType) {
      EdmComplexType complex = (EdmComplexType) type;
      Map<String, EntityPropertyInfo> recursiveInfos = createPropertyInfoObjects(complex, complex.getPropertyNames());
      return EntityComplexPropertyInfo.create(property, complex.getPropertyNames(), recursiveInfos);
    } else {
      throw new EntityProviderException(EntityProviderException.UNSUPPORTED_PROPERTY_TYPE);
    }
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

  private EntityPropertyInfo createEntityPropertyInfo(final EdmFunctionImport functionImport, final EdmType type)
      throws EdmException, EntityProviderException {
    EntityPropertyInfo epi;

    if (type.getKind() == EdmTypeKind.COMPLEX) {
      EdmComplexType complex = (EdmComplexType) type;
      Map<String, EntityPropertyInfo> eia = EntityInfoAggregator.create(complex);

      List<EntityPropertyInfo> childEntityInfoList = new ArrayList<EntityPropertyInfo>();
      for (String propertyName : complex.getPropertyNames()) {
        childEntityInfoList.add(eia.get(propertyName));
      }
      epi = new EntityComplexPropertyInfo(functionImport.getName(), type, null, null, childEntityInfoList);

    } else if (type.getKind() == EdmTypeKind.SIMPLE) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

    FullQualifiedName fqName = new FullQualifiedName(namespace, name);
    if (edmComplexTypes.containsKey(fqName)) {
      return edmComplexTypes.get(fqName);
    }

    EdmComplexType edmComplexType = null;

    try {
      edmComplexType = createComplexType(fqName);
      if (edmComplexType != null) {
        edmComplexTypes.put(fqName, edmComplexType);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

      return edmEntityType;
    }

    @Override
    protected EdmComplexType createComplexType(final FullQualifiedName fqName) throws ODataException {
      EdmComplexType edmComplexType = mock(EdmComplexType.class);
      when(edmComplexType.getNamespace()).thenReturn(fqName.getNamespace());
      when(edmComplexType.getName()).thenReturn(fqName.getName());
      return edmComplexType;
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

      EasyMock.expect(edmProperty.getMapping()).andReturn((EdmMapping) mockEdmMapping(entityName, propertyName, null))
          .anyTimes();

    } else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE) ||
        propertyName.equals(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE)) {
      EdmComplexType complexType = mockComplexType(propertyName);

      EasyMock.expect(edmProperty.getType()).andReturn(complexType).anyTimes();
      EasyMock.expect(edmProperty.getName()).andReturn(propertyName).anyTimes();
      EasyMock.expect(edmProperty.getMapping()).andReturn((EdmMapping) mockEdmMapping(null, propertyName, null))
          .anyTimes();
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmComplexType

      complexTypeName = JPATypeEmbeddableMock2.ENTITY_NAME;
    } else if (complexPropertyName.equals(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE)) {
      complexTypeName = JPATypeEmbeddableMock.ENTITY_NAME;
    }

    EdmComplexType edmComplexType = EasyMock.createMock(EdmComplexType.class);
    EasyMock.expect(edmComplexType.getKind()).andReturn(EdmTypeKind.COMPLEX);
    EasyMock.expect(edmComplexType.getPropertyNames()).andReturn(mockPropertyNames(complexTypeName)).anyTimes();
    EasyMock.expect(edmComplexType.getMapping()).andReturn((EdmMapping) mockEdmMapping(complexTypeName, null, null));

    if (complexTypeName.equals(JPATypeEmbeddableMock.ENTITY_NAME)) {
      EasyMock.expect(edmComplexType.getProperty(JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT)).andReturn(
          mockEdmProperty(complexTypeName, JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT)).anyTimes();
      EasyMock.expect(edmComplexType.getProperty(JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE)).andReturn(
          mockEdmProperty(complexTypeName, JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE)).anyTimes();
    } else if (complexTypeName.equals(JPATypeEmbeddableMock2.ENTITY_NAME)) {
      EasyMock.expect(edmComplexType.getProperty(JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT)).andReturn(
          mockEdmProperty(complexTypeName, JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT)).anyTimes();
      EasyMock.expect(edmComplexType.getProperty(JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID)).andReturn(
          mockEdmProperty(complexTypeName, JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID)).anyTimes();
    }

    EasyMock.replay(edmComplexType);
    return edmComplexType;
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.