Examples of JPAEdmMappingModelAccess


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

   */
  public static void build(final JPAEdmEntityTypeView view) {

    EntityType edmEntityType = view.getEdmEntityType();
    String jpaEntityName = view.getJPAEntityType().getName();
    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String edmEntityTypeName = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName);
    }

    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(view.getJPAEntityType().getJavaType());

View Full Code Here

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

    Attribute<?, ?> jpaAttribute = view.getJPAAttribute();
    String jpaAttributeName = jpaAttribute.getName();
    String propertyName = null;
    String[] joinColumnNames = null;

    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      if (isComplexMode) {
        propertyName =
            mappingModelAccess.mapJPAEmbeddableTypeAttribute(view.getJPAEdmComplexTypeView().getJPAEmbeddableType()
                .getJavaType().getSimpleName(), jpaAttributeName);
      } else {
        propertyName =
            mappingModelAccess.mapJPAAttribute(view.getJPAEdmEntityTypeView().getJPAEntityType().getName(),
                jpaAttributeName);
      }
    }
    if (skipDefaultNaming == false && propertyName == null) {
      propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1);
View Full Code Here

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

   * 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 Full Code Here

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

   * EDM Complex Type Name - RULES
   * ************************************************************************
   */
  public static void build(final JPAEdmComplexType view) {

    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String jpaEmbeddableTypeName = view.getJPAEmbeddableType().getJavaType().getSimpleName();
    String edmComplexTypeName = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      edmComplexTypeName = mappingModelAccess.mapJPAEmbeddableType(jpaEmbeddableTypeName);
    }

    if (edmComplexTypeName == null) {
      edmComplexTypeName = jpaEmbeddableTypeName;
    }
View Full Code Here

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

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

  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

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

    } 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

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

    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

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

    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

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

    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
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.