Package org.apache.olingo.odata2.jpa.processor.api.access

Examples of org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmMappingModelAccess


    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) {
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;
View Full Code Here

    } else {
      jpaEntityTypeName = propertyView.getJPAAttribute().getJavaType()
          .getSimpleName();
    }

    JPAEdmMappingModelAccess mappingModelAccess = assocaitionEndView.getJPAEdmMappingModelAccess();

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

    if (name == null) {
      name = jpaEntityTypeName;
    }
View Full Code Here

    assocaitionEndView.getEdmAssociationEnd2().setType(fQName);

  }

  private static String buildNamespace(final JPAEdmBaseView view) {
    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String namespace = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      namespace = mappingModelAccess.mapJPAPersistenceUnit(view.getpUnitName());
    }
    if (namespace == null) {
      namespace = view.getpUnitName();
    }
View Full Code Here

    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;
    }
View Full Code Here

    return complexTypeView;
  }

  private boolean isExcluded(final JPAEdmPropertyView jpaEdmPropertyView, final String jpaEntityTypeName,
      final String jpaAttributeName) {
    JPAEdmMappingModelAccess mappingModelAccess = jpaEdmPropertyView
        .getJPAEdmMappingModelAccess();
    boolean isExcluded = false;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      // Exclusion of a simple property in a complex type
      if (isBuildModeComplexType
          && mappingModelAccess.checkExclusionOfJPAEmbeddableAttributeType(jpaEntityTypeName, jpaAttributeName)
          // Exclusion of a simple property of an Entity Type
          || (!isBuildModeComplexType && mappingModelAccess.checkExclusionOfJPAAttributeType(jpaEntityTypeName,
              jpaAttributeName))) {
        isExcluded = true;
      }
    }
    return isExcluded;
View Full Code Here

      }

    }

    private boolean isExcluded(final JPAEdmEntityType jpaEdmEntityType) {
      JPAEdmMappingModelAccess mappingModelAccess = jpaEdmEntityType.getJPAEdmMappingModelAccess();
      if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()
          && mappingModelAccess.checkExclusionOfJPAEntityType(jpaEdmEntityType.getJPAEntityType().getName())) {
        return true;
      }
      return false;
    }
View Full Code Here

      }

    }

    private boolean isExcluded(final JPAEdmEntityType jpaEdmEntityType) {
      JPAEdmMappingModelAccess mappingModelAccess = jpaEdmEntityType.getJPAEdmMappingModelAccess();
      if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()
          && mappingModelAccess.checkExclusionOfJPAEntityType(jpaEdmEntityType.getJPAEntityType().getName())) {
        return true;
      }
      return false;
    }
View Full Code Here

      }
    }

    @Override
    public JPAEdmMappingModelAccess getJPAEdmMappingModelAccess(final ODataJPAContext oDataJPAContext) {
      JPAEdmMappingModelAccess mappingModelAccess = new JPAEdmMappingModelService(oDataJPAContext);

      return mappingModelAccess;
    }
View Full Code Here

    assocaitionEndView.getEdmAssociationEnd2().setType(fQName);

  }

  private static String buildNamespace(final JPAEdmBaseView view) {
    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String namespace = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      namespace = mappingModelAccess.mapJPAPersistenceUnit(view.getpUnitName());
    }
    if (namespace == null) {
      namespace = view.getpUnitName();
    }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmMappingModelAccess

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.