Package org.odata4j.edm

Examples of org.odata4j.edm.EdmEntityType.findNavigationProperty()


        } else if (propValue instanceof ShortBlob) {
          propValue = ((ShortBlob) propValue).getBytes();
        }
        properties.add(OProperties.simple(propName, (EdmSimpleType<?>) prop.getType(), propValue));
      } else {
        EdmNavigationProperty navProp = eet.findNavigationProperty(propName);
        if (navProp != null) {
          List<OEntity> expandedProps = new ArrayList<OEntity>();
          try {
            if (queryInfo != null && queryInfo.expand != null && queryInfo.expand.size() > 0) {
              for (EntitySimpleProperty esp : queryInfo.expand) {
View Full Code Here


        String uri = link.getHref();
        String entitySetName = e.getKind();
        String key = uri.substring(uri.lastIndexOf('('));
        EdmEntitySet ees = metadata.getEdmEntitySet(entitySetName);
        EdmEntityType eet = ees.getType();
        EdmNavigationProperty enp = eet.findNavigationProperty(link.getRelation());
        EdmMultiplicity em = enp.getRelationship().getEnd2().getMultiplicity();
        Entity entity = findEntity(enp.getToRole().getType().getName(), OEntityKey.parse(key));
        if (em == EdmMultiplicity.ZERO_TO_ONE) {
          e.setProperty(link.getRelation(), entity.getKey());
        } else {
View Full Code Here

    // Support for filtering navigation properties by key
    if (propName.contains("/")) {
      propName = propName.substring(0, propName.indexOf("/"));
      EdmEntitySet ees = metadata.getEdmEntitySet(q.getKind());
      EdmEntityType eet = ees.getType();
      EdmNavigationProperty enp = eet.findNavigationProperty(propName);
      long id = Long.parseLong(propValue.toString());
      propValue = KeyFactory.createKey(enp.getToRole().getRole(), id);
    }

    Filter filter = new FilterPredicate(propName, op, propValue);
View Full Code Here

  @Override
  public BaseResponse getNavProperty(String entitySetName, OEntityKey entityKey, String navProp, QueryInfo queryInfo) {
    final EdmEntitySet ees = metadata.getEdmEntitySet(entitySetName);
    EdmEntityType eet = ees.getType();
    EdmNavigationProperty enp = eet.findNavigationProperty(navProp);
    if (enp == null) {
      throw new NotFoundException("EdmNavigationProperty " + navProp + " not found.");
    }
    final EdmEntitySet eesNavProp = metadata.getEdmEntitySet(enp.getToRole().getRole());
    EdmMultiplicity relMultiplicity = enp.getRelationship().getEnd2().getMultiplicity();
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.