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

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


        return associationEnd;
      }

      @Override
      public AssociationEnd getEdmAssociationEnd2() {
        AssociationEnd associationEnd = new AssociationEnd();
        associationEnd.setType(new FullQualifiedName("salesorderprocessing", "SalesOrderItem"));
        associationEnd.setRole("SalesOrderItem");
        associationEnd.setMultiplicity(EdmMultiplicity.MANY);
        return associationEnd;
      }
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", "SalesOrderItem")));

        return association;
      }
View Full Code Here

  @Override
  public Association getEdmAssociation() {

    Association association = new Association();
    association.setName("Assoc_SalesOrderHeader_SalesOrderItem");
    association.setEnd1(new AssociationEnd().setType(
        new FullQualifiedName("salesorderprocessing", "String"))
        .setRole("SalesOrderHeader"));
    association.setEnd2(new AssociationEnd()
        .setType(
            new FullQualifiedName("salesorderprocessing",
                "SalesOrderItem")).setRole("SalesOrderItem"));
    return association;
  }
View Full Code Here

        name2Associations.put(relationshipName, association);
      }
    }

    private Association mergeAssociations(final Association associationOne, final Association associationTwo) {
      AssociationEnd oneEnd1 = associationOne.getEnd1();
      AssociationEnd oneEnd2 = associationOne.getEnd2();
      AssociationEnd twoEnd1 = associationTwo.getEnd1();
      AssociationEnd twoEnd2 = associationTwo.getEnd2();
      AssociationEnd[] oneEnds = new AssociationEnd[] { oneEnd1, oneEnd2 };

      for (AssociationEnd associationEnd : oneEnds) {
        if (associationEnd.getRole().equals(twoEnd1.getRole())) {
          if (twoEnd1.getMultiplicity() == EdmMultiplicity.MANY) {
            associationEnd.setMultiplicity(EdmMultiplicity.MANY);
          }
        } else if (associationEnd.getRole().equals(twoEnd2.getRole())) {
          if (twoEnd2.getMultiplicity() == EdmMultiplicity.MANY) {
            associationEnd.setMultiplicity(EdmMultiplicity.MANY);
          }
        }
      }
View Full Code Here

  @Override
  public Association getEdmAssociation() {
    Association association = new Association();
    association.setName("Assoc_SalesOrderHeader_SalesOrderItem");
    association.setEnd1(new AssociationEnd().setType(new FullQualifiedName("salesorderprocessing", "String")).setRole(
        "SalesOrderHeader"));
    association.setEnd2(new AssociationEnd().setType(new FullQualifiedName("salesorderprocessing", "SalesOrderItem"))
        .setRole("SalesOrderItem"));
    return association;
  }
View Full Code Here

    assertEquals(builder1.hashCode(), builder2.hashCode());
  }

  @Test
  public void testGetAssociationEnd1() {
    AssociationEnd associationEnd = objJPAEdmAssociationEnd.getEdmAssociationEnd1();
    assertEquals(associationEnd.getType().getName(), "SOID");
  }
View Full Code Here

    assertEquals(associationEnd.getType().getName(), "SOID");
  }

  @Test
  public void testGetAssociationEnd2() {
    AssociationEnd associationEnd = objJPAEdmAssociationEnd.getEdmAssociationEnd2();
    assertEquals(associationEnd.getType().getName(), "String");
  }
View Full Code Here

    assertTrue(objJPAEdmAssociationEnd.isConsistent());

  }

  private AssociationEnd getAssociationEnd(final String typeName, final int variant) {
    AssociationEnd associationEnd = new AssociationEnd();
    associationEnd.setType(getFullQualifiedName(typeName));
    if (variant == VARIANT1) {
      associationEnd.setMultiplicity(EdmMultiplicity.MANY);
    } else if (variant == VARIANT2) {
      associationEnd.setMultiplicity(EdmMultiplicity.ONE);
    } else if (variant == VARIANT3) {
      associationEnd.setMultiplicity(EdmMultiplicity.ZERO_TO_ONE);
    } else {
      associationEnd.setMultiplicity(EdmMultiplicity.MANY);//
    }
    return associationEnd;
  }
View Full Code Here

  public static void getEdmEntityContainerImpl() throws Exception {

    edmProvider = mock(EdmProvider.class);
    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);

    AssociationEnd end1 =
        new AssociationEnd().setRole("end1Role").setMultiplicity(EdmMultiplicity.ONE).setType(
            EdmSimpleTypeKind.String.getFullQualifiedName());

    associationEndProv = new EdmAssociationEndImplProv(edmImplProv, end1);
  }
View Full Code Here

    @Override
    public void build() throws ODataJPAModelException {

      JoinColumn joinColumn = null;

      currentAssociationEnd1 = new AssociationEnd();
      currentAssociationEnd2 = new AssociationEnd();

      JPAEdmNameBuilder.build(JPAEdmAssociationEnd.this, entityTypeView, propertyView);

      currentAssociationEnd1.setRole(currentAssociationEnd1.getType().getName());
      currentAssociationEnd2.setRole(currentAssociationEnd2.getType().getName());
View Full Code Here

TOP

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

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.