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

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


  }

  private Key createKey(final String... keyNames) {
    final List<PropertyRef> keyProperties = new ArrayList<PropertyRef>();
    for (final String keyName : keyNames) {
      keyProperties.add(new PropertyRef().setName(keyName));
    }
    return new Key().setKeys(keyProperties);
  }
View Full Code Here


  }

  private Key getKey(final String... keyNames) {
    List<PropertyRef> keyProperties = new ArrayList<PropertyRef>();
    for (final String keyName : keyNames) {
      keyProperties.add(new PropertyRef().setName(keyName));
    }
    return new Key().setKeys(keyProperties);
  }
View Full Code Here

  private static Key createKey(final String[] keyNames) {
    Key key = new Key();
    List<PropertyRef> keys = new ArrayList<PropertyRef>();
    for (String keyName : keyNames) {
      keys.add(new PropertyRef().setName(keyName));
    }
    key.setKeys(keys);
    return null;
  }
View Full Code Here

        List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
        if (edmEntityType != null) {
          for (String columnName : jpaColumnNames) {
            for (Property property : edmEntityType.getProperties()) {
              if (columnName.equals(((JPAEdmMapping) property.getMapping()).getJPAColumnName())) {
                PropertyRef propertyRef = new PropertyRef();
                propertyRef.setName(property.getName());
                propertyRefs.add(propertyRef);
                break;
              }
            }
          }
View Full Code Here

    List<Property> keyPropertysFoo = new ArrayList<Property>();
    Property keyPropFoo = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
    keyPropertysFoo.add(keyPropFoo);
    fooEntityType.setProperties(keyPropertysFoo);

    PropertyRef refToKeyFoo = new PropertyRef().setName("Id");
    List<PropertyRef> propRefKeysFoo = new ArrayList<PropertyRef>();
    propRefKeysFoo.add(refToKeyFoo);

    Key fooTypeKey = new Key().setKeys(propRefKeysFoo);
    fooEntityType.setKey(fooTypeKey);

    edmEntityType = new EdmEntityTypeImplProv(edmImplProv, fooEntityType, "namespace");

    FullQualifiedName barBaseTypeName = new FullQualifiedName("namespace", "barBase");
    EntityType barBase = new EntityType().setName("barBase");
    when(edmProvider.getEntityType(barBaseTypeName)).thenReturn(barBase);

    List<NavigationProperty> navigationPropertiesBarBase = new ArrayList<NavigationProperty>();
    navigationPropertiesBarBase.add(new NavigationProperty().setName("barBaseNav"));
    barBase.setNavigationProperties(navigationPropertiesBarBase);

    List<Property> keyPropertysBarBase = new ArrayList<Property>();
    Property keyPropBarBase = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
    keyPropertysBarBase.add(keyPropBarBase);
    barBase.setProperties(keyPropertysBarBase);

    PropertyRef refToKeyBarBase = new PropertyRef().setName("Id");
    List<PropertyRef> propRefKeysBarBase = new ArrayList<PropertyRef>();
    propRefKeysBarBase.add(refToKeyBarBase);

    Key barBaseTypeKey = new Key().setKeys(propRefKeysBarBase);
    barBase.setKey(barBaseTypeKey);
View Full Code Here

      if (isBuildModeComplexType) {
        ComplexType complexType =
            complexTypeView.searchEdmComplexType(propertyView.getJPAAttribute().getJavaType().getName());
        normalizeComplexKey(complexType, propertyRefList);
      } else {
        PropertyRef propertyRef = new PropertyRef();
        propertyRef.setName(propertyView.getEdmSimpleProperty().getName());
        Facets facets = (Facets) propertyView.getEdmSimpleProperty().getFacets();
        if (facets == null) {
          propertyView.getEdmSimpleProperty().setFacets(new Facets().setNullable(false));
        } else {
          facets.setNullable(false);
View Full Code Here

          if (facets == null) {
            simpleProperty.setFacets(new Facets().setNullable(false));
          } else {
            facets.setNullable(false);
          }
          PropertyRef propertyRef = new PropertyRef();
          propertyRef.setName(simpleProperty.getName());
          propertyRefList.add(propertyRef);

        } catch (ClassCastException e) {
          ComplexProperty complexProperty = (ComplexProperty) property;
          normalizeComplexKey(complexTypeView.searchEdmComplexType(complexProperty.getType()), propertyRefList);
View Full Code Here

        annotationAttributes);
  }

  private PropertyRef readPropertyRef(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
    reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_PROPERTY_REF);
    PropertyRef propertyRef = new PropertyRef();
    propertyRef.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME));
    List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>();
    propertyRef.setAnnotationAttributes(readAnnotationAttribute(reader));
    while (reader.hasNext() && !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI())
        && XmlMetadataConstants.EDM_PROPERTY_REF.equals(reader.getLocalName()))) {
      reader.next();
      if (reader.isStartElement()) {
        extractNamespaces(reader);
        annotationElements.add(readAnnotationElement(reader));
      }
    }
    return propertyRef.setAnnotationElements(annotationElements);
  }
View Full Code Here

    public Collection<Association> buildAssociations() {
      return Collections.unmodifiableCollection(associations);
    }

    private PropertyRef createKeyProperty(final EdmProperty et, final Field field) {
      PropertyRef keyProperty = new PropertyRef();
      String entityName = et.name();
      if (entityName.isEmpty()) {
        entityName = getCanonicalName(field);
      }
      return keyProperty.setName(entityName);
    }
View Full Code Here

            // $count
            try {
                final String stringCount = new String(EntityProvider.readBinary(content), ContentType.CHARSET_UTF_8);
                response = (T) Long.valueOf(stringCount);
            } catch (UnsupportedEncodingException e) {
                throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED, e);
            }
            break;

        case URI1:
        case URI6B:
View Full Code Here

TOP

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

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.