Examples of JPAEdmMappingImpl


Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

    ((Mapping) mapping).setInternalName("Gentleman");
    return mapping;
  }

  private JPAEdmMappingImpl getMapping() {
    JPAEdmMappingImpl mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(FunctionImportTestClass.class);
    ((Mapping) mapping).setInternalName("testMethod");
    return mapping;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

  private static List<Property> createComplexTypePropertiesTwo() {
    List<Property> properties = new ArrayList<Property>();
    SimpleProperty property = new SimpleProperty();
    property.setName("SoId");
    property.setType(EdmSimpleTypeKind.Int64);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("Sales_Order_Id");
    ((Mapping) mapping).setInternalName("SalesOrderItemKey.SoId");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    property = new SimpleProperty();
    property.setName("LiId");
    property.setType(EdmSimpleTypeKind.Int64);
    mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("Sales_Order_Item_Id");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    return properties;

  }
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

  private static List<Property> createComplexTypePropertiesOne() {
    List<Property> properties = new ArrayList<Property>();
    SimpleProperty property = new SimpleProperty();
    property.setName("StreetName");
    property.setType(EdmSimpleTypeKind.String);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("STREET_NAME");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    property = new SimpleProperty();
    property.setName("City");
    property.setType(EdmSimpleTypeKind.String);
    mapping = new JPAEdmMappingImpl();
    mapping.setJPAColumnName("CITY");
    property.setMapping((Mapping) mapping);
    properties.add(property);
    return properties;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

    return edmComplexType;
  }

  public static JPAEdmMapping mockEdmMapping(final String entityName, final String propertyName,
      final String navigationPropertyName) {
    JPAEdmMapping mapping = new JPAEdmMappingImpl();

    if (propertyName == null && entityName != null) {
      if (entityName.equals(JPATypeMock.ENTITY_NAME)) {
        mapping.setJPAType(JPATypeMock.class);
      } else if (entityName.equals(JPARelatedTypeMock.ENTITY_NAME)) {
        mapping.setJPAType(JPARelatedTypeMock.class);
      } else if (entityName.equals(JPATypeEmbeddableMock.ENTITY_NAME)) {
        mapping.setJPAType(JPATypeEmbeddableMock.class);
      } else if (entityName.equals(JPATypeEmbeddableMock2.ENTITY_NAME)) {
        mapping.setJPAType(JPATypeEmbeddableMock2.class);
      }
    } else if (entityName == null && navigationPropertyName != null) {
      mapping.setJPAType(JPARelatedTypeMock.class);
      mapping.setJPAColumnName(JPATypeMock.NAVIGATION_PROPERTY_X);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MINT)) {
      mapping.setJPAType(int.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MINT);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MSTRING)) {
      mapping.setJPAType(String.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MSTRING);
    else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MDATETIME)) {
      mapping.setJPAType(Calendar.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MDATETIME);
    else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MLONG)) {
      mapping.setJPAType(long.class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MLONG);
    else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MDOUBLE)) {
      mapping.setJPAType(double.class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MDOUBLE);
    else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MBYTE)) {
      mapping.setJPAType(byte.class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MBYTE);
    else if (propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MBYTEARRAY)) {
      mapping.setJPAType(byte[].class);
      ((Mapping) mapping).setInternalName(JPARelatedTypeMock.PROPERTY_NAME_MBYTEARRAY);
    else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT)) {
      mapping.setJPAType(Short.TYPE);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT);
    else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT)) {
      mapping.setJPAType(Float.TYPE);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT);
    else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID)) {
      mapping.setJPAType(UUID.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID);
    else if (propertyName.equals(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE)) {
      mapping.setJPAType(JPATypeEmbeddableMock2.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MEMBEDDABLE);
    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE)) {
      mapping.setJPAType(JPATypeEmbeddableMock.class);
      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE);
    }
    return mapping;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

    String edmEntityTypeName = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName);
    }

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

    if (edmEntityTypeName == null) {
      edmEntityTypeName = jpaEntityName;
    }
    // Setting the mapping object
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

      propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1);
    }

    view.getEdmSimpleProperty().setName(propertyName);

    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    ((Mapping) mapping).setInternalName(jpaAttributeName);
    mapping.setJPAType(jpaAttribute.getJavaType());

    AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
    if (annotatedElement != null) {
      Column column = annotatedElement.getAnnotation(Column.class);
      if (column != null) {
        mapping.setJPAColumnName(column.name());
      }
    } else {
      ManagedType<?> managedType = jpaAttribute.getDeclaringType();
      if (managedType != null) {
        Class<?> clazz = managedType.getJavaType();
        try {
          Field field = clazz.getDeclaredField(jpaAttributeName);
          Column column = field.getAnnotation(Column.class);
          if (column != null) {
            mapping.setJPAColumnName(column.name());
          }
        } catch (SecurityException e) {

        } catch (NoSuchFieldException e) {
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

    }

    view.getEdmComplexType().setName(edmComplexTypeName);
    ComplexType complexType = view.getEdmComplexType();
    complexType.setName(edmComplexTypeName);
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(view.getJPAEmbeddableType().getJavaType());
    complexType.setMapping((Mapping) mapping);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

    if (propertyName == null) {
      propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1);
    }
    // change for navigation property issue
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    ((Mapping) mapping).setInternalName(jpaAttributeName);
    mapping.setJPAType(propertyView.getJPAAttribute().getJavaType());
    complexProperty.setMapping((Mapping) mapping);

    complexProperty.setName(propertyName);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.processor.core.jpa.model.JPAEdmMappingImpl

      propertyName = mappingModelAccess.mapJPAEmbeddableTypeAttribute(parentComplexTypeName, jpaAttributeName);
    }
    if (propertyName == null) {
      propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1);
    }
    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    ((Mapping) mapping).setInternalName(jpaAttributeName);
    mapping.setJPAType(propertyView.getJPAAttribute().getJavaType());
    complexProperty.setMapping((Mapping) mapping);
    complexProperty.setName(propertyName);

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