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

Examples of org.apache.olingo.odata2.api.edm.EdmException


  @Override
  public EdmAssociation getAssociation() throws EdmException {
    EdmAssociation association =
        edm.getAssociation(associationSet.getAssociation().getNamespace(), associationSet.getAssociation().getName());
    if (association == null) {
      throw new EdmException(EdmException.COMMON);
    }
    return association;
  }
View Full Code Here


      return null;
    }

    EdmEntitySet entitySet = edmEntityContainer.getEntitySet(end.getEntitySet());
    if (entitySet == null) {
      throw new EdmException(EdmException.COMMON);
    }

    return new EdmAssociationSetEndImplProv(end, entitySet);
  }
View Full Code Here

  @Override
  public EdmEntityType getEntityType() throws EdmException {
    final FullQualifiedName type = associationEnd.getType();
    EdmEntityType entityType = edm.getEntityType(type.getNamespace(), type.getName());
    if (entityType == null) {
      throw new EdmException(EdmException.COMMON);
    }
    return entityType;
  }
View Full Code Here

  @Override
  public EdmType getType() throws EdmException {
    if (edmType == null) {
      edmType = EdmSimpleTypeFacadeImpl.getEdmSimpleType(property.getType());
      if (edmType == null) {
        throw new EdmException(EdmException.COMMON);
      }
    }
    return edmType;
  }
View Full Code Here

        entitySetUri = new URI(entitySetName);
      } else {
        entitySetUri = new URI(entityContainerName + "." + entitySetName);
      }
    } catch (URISyntaxException e) {
      throw new EdmException(EdmException.COMMON, e);
    }

  }
View Full Code Here

    private void handleCustomLinks(final EdmEntityType entityType) throws EdmException {
      for (Map.Entry<String, ExpandSelectTreeNode> entry : customExpandedNavigationProperties.entrySet()) {
        EdmTyped navigationProperty = entityType.getProperty(entry.getKey());
        if (navigationProperty == null) {
          throw new EdmException(EdmException.NAVIGATIONPROPERTYNOTFOUND.addContent(entry.getKey()));
        }
        if (!(navigationProperty instanceof EdmNavigationProperty)) {
          throw new EdmException(EdmException.MUSTBENAVIGATIONPROPERTY.addContent(entry.getKey()));
        }
        putLink(entry.getKey(), (ExpandSelectTreeNodeImpl) entry.getValue());
      }
    }
View Full Code Here

    private void handleLinks(final EdmEntityType entityType, final List<String> names,
        final ExpandSelectTreeNodeImpl subNode) throws EdmException {
      for (String navigationPropertyName : names) {
        EdmTyped navigationProperty = entityType.getProperty(navigationPropertyName);
        if (navigationProperty == null) {
          throw new EdmException(EdmException.NAVIGATIONPROPERTYNOTFOUND.addContent(navigationPropertyName));
        } else if (!(navigationProperty instanceof EdmNavigationProperty)) {
          throw new EdmException(EdmException.MUSTBENAVIGATIONPROPERTY.addContent(navigationPropertyName));
        }
        putLink(navigationPropertyName, subNode);
      }
    }
View Full Code Here

    private void handleProperties(final EdmEntityType entityType) throws EdmException {
      for (String propertyName : selectedPropertyNames) {
        EdmTyped property = entityType.getProperty(propertyName);
        if (property == null) {
          throw new EdmException(EdmException.PROPERTYNOTFOUND.addContent(propertyName));
        } else if (!(property instanceof EdmProperty)) {
          throw new EdmException(EdmException.MUSTBEPROPERTY.addContent(propertyName));
        }
        addProperty((EdmProperty) property);
      }
    }
View Full Code Here

        edmBaseType = edm.getComplexType(fqName.getNamespace(), fqName.getName());
      } else if (EdmTypeKind.ENTITY.equals(edmTypeKind)) {
        edmBaseType = edm.getEntityType(fqName.getNamespace(), fqName.getName());
      }
      if (edmBaseType == null) {
        throw new EdmException(EdmException.COMMON);
      }
    }
  }
View Full Code Here

    if (property instanceof SimpleProperty) {
      return new EdmSimplePropertyImplProv(edm, (SimpleProperty) property);
    } else if (property instanceof ComplexProperty) {
      return new EdmComplexPropertyImplProv(edm, (ComplexProperty) property);
    } else {
      throw new EdmException(EdmException.COMMON);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.edm.EdmException

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.