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

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


    assertTrue(objComplexType.getConsistentEdmComplexTypes().size() > 0);
  }

  @Test
  public void testSearchComplexTypeFullQualifiedName() {
    assertNotNull(objComplexType.searchEdmComplexType(new FullQualifiedName("salesorderprocessing", "String")));

  }
View Full Code Here


  }

  @Test
  public void testSearchComplexTypeFullQualifiedNameNegative() {
    assertNull(objComplexType.searchEdmComplexType(new FullQualifiedName("salesorderprocessing", "lang.String")));
  }
View Full Code Here

        String nameSpace = schemaView.getEdmSchema().getNamespace();
        for (EntityType entityType : entityTypeView.getConsistentEdmEntityTypes()) {

          currentEntitySet = new EntitySet();
          currentEntitySet.setEntityType(new FullQualifiedName(nameSpace, entityType.getName()));
          JPAEdmNameBuilder.build(JPAEdmEntitySet.this, entityTypeView);
          consistentEntitySetList.add(currentEntitySet);

        }
        isConsistent = true;
View Full Code Here

      if (associationView.isConsistent()) {
        for (Association association : associationView.getConsistentEdmAssociationList()) {

          currentAssociation = association;

          FullQualifiedName fQname =
              new FullQualifiedName(schemaView.getEdmSchema().getNamespace(), association.getName());
          currentAssociationSet = new AssociationSet();
          currentAssociationSet.setAssociation(fQname);

          int endCount = 0;
          short endFlag = 0;
          for (EntitySet entitySet : entitySetList) {
            fQname = entitySet.getEntityType();
            endFlag = 0;
            if (fQname.equals(association.getEnd1().getType()) || ++endFlag > 1
                || fQname.equals(association.getEnd2().getType())) {

              AssociationSetEnd end = new AssociationSetEnd();
              end.setEntitySet(entitySet.getName());
              if (endFlag == 0) {
                currentAssociationSet.setEnd1(end);
View Full Code Here

    entityType.setProperties(Arrays.asList(property1, property2, property3));
    entityType.setMapping(new Mapping().setObject(mapping[ENTITYTYPE][BACKEND]));

    entitySet = new EntitySet();
    entitySet.setName(mapping[ENTITYSET][EDM]);
    entitySet.setEntityType(new FullQualifiedName(NAMESPACE, mapping[ENTITYTYPE][EDM]));
    entitySet.setMapping(new Mapping().setObject(mapping[ENTITYSET][BACKEND]));

    entityContainer = new EntityContainer();
    entityContainer.setDefaultEntityContainer(true);
    entityContainer.setName(MAPPING_CONTAINER);
View Full Code Here

  @Override
  public Association getEdmAssociation() {
    Association association = new Association();
    association
        .setEnd1(new AssociationEnd().setType(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader")));
    association.setEnd2(new AssociationEnd().setType(new FullQualifiedName("salesorderprocessing", "String")));

    return association;
  }
View Full Code Here

    assertNotNull(entityContainer);
  }

  @Test
  public void testGetEntityType() {
    FullQualifiedName entityTypeName = new FullQualifiedName("salesorderprocessing", "SalesOrderHeader");
    String entityName = null;
    try {
      entityName = edmProvider.getEntityType(entityTypeName).getName();
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
    assertEquals("SalesOrderHeader", entityName);
    try {
      edmProvider.getEntityType(new FullQualifiedName("salesorder", "abc"));
    } catch (ODataException e) {
      assertTrue(true);
    }

  }
View Full Code Here

  }

  @Test
  public void testGetComplexType() {
    FullQualifiedName complexTypeName = new FullQualifiedName("salesorderprocessing", "Address");
    String nameStr = null;
    try {
      nameStr = edmProvider.getComplexType(complexTypeName).getName();
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
View Full Code Here

  @Test
  public void testGetAssociationFullQualifiedName() {
    Association association = null;
    try {
      association =
          edmProvider.getAssociation(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader_SalesOrderItem"));
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
    assertNotNull(association);
    assertEquals("SalesOrderHeader_SalesOrderItem", association.getName());
View Full Code Here

  public void testGetAssociationSet() {
    AssociationSet associationSet = null;

    try {
      associationSet =
          edmProvider.getAssociationSet("salesorderprocessingContainer", new FullQualifiedName("salesorderprocessing",
              "SalesOrderHeader_SalesOrderItem"), "SalesOrderHeaders", "SalesOrderHeader");
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
    assertNotNull(associationSet);
    assertEquals("SalesOrderHeader_SalesOrderItemSet", associationSet.getName());
    try {
      associationSet =
          edmProvider.getAssociationSet("salesorderprocessingContainer", new FullQualifiedName("salesorderprocessing",
              "SalesOrderHeader_SalesOrderItem"), "SalesOrderItems", "SalesOrderItem");
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
    assertNotNull(associationSet);
    try {
      associationSet =
          edmProvider.getAssociationSet("salesorderproceContainer", new FullQualifiedName("salesorderprocessing",
              "SalesOrderHeader_SalesOrderItem"), "SalesOrderItems", "SalesOrderItem");
    } catch (ODataException e) {
      assertTrue(true);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.edm.FullQualifiedName

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.