Examples of FullQualifiedName


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

    if (edmAssociationSet != null) {
      return edmAssociationSet;
    }

    AssociationSet associationSet;
    FullQualifiedName associationFQName =
        new FullQualifiedName(edmAssociation.getNamespace(), edmAssociation.getName());
    try {
      associationSet =
          edm.edmProvider.getAssociationSet(entityContainerInfo.getName(), associationFQName, entitySetName,
              entitySetFromRole);
    } catch (ODataException e) {
View Full Code Here

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

  }

  @Override
  public AssociationEnd getEdmAssociationEnd1() {
    AssociationEnd associationEnd = new AssociationEnd();
    associationEnd.setType(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader"));
    associationEnd.setRole("SalesOrderHeader");
    associationEnd.setMultiplicity(EdmMultiplicity.ONE);
    return associationEnd;
  }
View Full Code Here

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

  }

  @Override
  public AssociationEnd getEdmAssociationEnd2() {
    AssociationEnd associationEnd = new AssociationEnd();
    associationEnd.setType(new FullQualifiedName("salesorderprocessing", "String"));
    associationEnd.setRole("String");
    associationEnd.setMultiplicity(EdmMultiplicity.MANY);
    return associationEnd;
  }
View Full Code Here

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

  @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

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

    class LocalJPAAssociationView extends JPAEdmTestModelView {
      @Override
      public AssociationEnd getEdmAssociationEnd1() {
        AssociationEnd associationEnd = new AssociationEnd();
        associationEnd.setType(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader"));
        associationEnd.setRole("SalesOrderHeader");
        associationEnd.setMultiplicity(EdmMultiplicity.ONE);
        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;
      }

      @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;
      }
    }
    LocalJPAAssociationView assocViewObj = new LocalJPAAssociationView();
View Full Code Here

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

  private static final String NAVIGATION_NAME = "Details";
  private static final String UNDERSCORE = "_";
  private static final String FK_PREFIX = "FK";

  public static FullQualifiedName build(final JPAEdmBaseView view, final String name) {
    FullQualifiedName fqName = new FullQualifiedName(buildNamespace(view), name);
    return fqName;
  }
View Full Code Here

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

   * ************************************************************************
   * EDM EntitySet Name - RULES
   * ************************************************************************
   */
  public static void build(final JPAEdmEntitySetView view, final JPAEdmEntityTypeView entityTypeView) {
    FullQualifiedName fQname = view.getEdmEntitySet().getEntityType();
    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String entitySetName = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      Mapping mapping = entityTypeView.getEdmEntityType().getMapping();
      if (mapping != null) {
        entitySetName = mappingModelAccess.mapJPAEntitySet(mapping.getInternalName());
      }
    }

    if (entitySetName == null) {
      entitySetName = fQname.getName() + ENTITY_SET_SUFFIX;
    }

    view.getEdmEntitySet().setName(entitySetName);
  }
View Full Code Here

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

      final JPAEdmEntityTypeView entityTypeView, final JPAEdmPropertyView propertyView) {

    String namespace = buildNamespace(assocaitionEndView);

    String name = entityTypeView.getEdmEntityType().getName();
    FullQualifiedName fQName = new FullQualifiedName(namespace, name);
    assocaitionEndView.getEdmAssociationEnd1().setType(fQName);

    name = null;
    String jpaEntityTypeName = null;
    Attribute<?, ?> jpaAttribute = propertyView.getJPAAttribute();
    if (jpaAttribute.isCollection()) {
      jpaEntityTypeName = ((PluralAttribute<?, ?, ?>) jpaAttribute).getElementType().getJavaType()
          .getSimpleName();
    } else {
      jpaEntityTypeName = propertyView.getJPAAttribute().getJavaType()
          .getSimpleName();
    }

    JPAEdmMappingModelAccess mappingModelAccess = assocaitionEndView.getJPAEdmMappingModelAccess();

    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      name = mappingModelAccess.mapJPAEntityType(jpaEntityTypeName);
    }

    if (name == null) {
      name = jpaEntityTypeName;
    }

    fQName = new FullQualifiedName(namespace, name);
    assocaitionEndView.getEdmAssociationEnd2().setType(fQName);

  }
View Full Code Here

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

    String navPropName = null;
    NavigationProperty navProp = navPropertyView.getEdmNavigationProperty();
    String namespace = buildNamespace(associationView);

    Association association = associationView.getEdmAssociation();
    navProp.setRelationship(new FullQualifiedName(namespace, association
        .getName()));

    FullQualifiedName associationEndTypeOne = association.getEnd1()
        .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
        .getJPAEdmMappingModelAccess();

    String targetEntityTypeName = null;
    if (jpaAttribute.isCollection()) {
      targetEntityTypeName = ((PluralAttribute<?, ?, ?>) jpaAttribute).getElementType().getJavaType().getSimpleName();
    } else {
      targetEntityTypeName = jpaAttribute.getJavaType().getSimpleName();
    }

    if (mappingModelAccess != null
        && mappingModelAccess.isMappingModelExists()) {
      navPropName = mappingModelAccess.mapJPARelationship(
          jpaEntityTypeName, jpaAttribute.getName());
      toName = mappingModelAccess.mapJPAEntityType(targetEntityTypeName);
      fromName = mappingModelAccess
          .mapJPAEntityType(jpaEntityTypeName);
    }
    if (toName == null) {
      toName = targetEntityTypeName;
    }

    if (fromName == null) {
      fromName = jpaEntityTypeName;
    }

    if (skipDefaultNaming == false) {
      if (navPropName == null) {
        navPropName = toName.concat(NAVIGATION_NAME);
      }
      if (count > 1) {
        navPropName = navPropName + Integer.toString(count - 1);
      }
    } else if (navPropName == null) {
      navPropName = jpaAttribute.getName();
    }

    navProp.setName(navPropName);

    if (toName.equals(associationEndTypeOne.getName())) {
      navProp.setFromRole(association.getEnd2().getRole());
      navProp.setToRole(association.getEnd1().getRole());
    } else if (toName.equals(associationEndTypeTwo.getName())) {

      navProp.setToRole(association.getEnd2().getRole());
      navProp.setFromRole(association.getEnd1().getRole());
    }
  }
View Full Code Here

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

    class LocalJPAAssociationView extends JPAEdmTestModelView {
      @Override
      public AssociationEnd getEdmAssociationEnd1() {
        AssociationEnd associationEnd = new AssociationEnd();
        associationEnd.setType(new FullQualifiedName("salesorderprocessing", "SalesOrderHeader"));
        associationEnd.setRole("SalesOrderHeader");
        associationEnd.setMultiplicity(EdmMultiplicity.ONE);
        return associationEnd;
      }
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.