public boolean isCollection() { if (!this.uriNavigations.isEmpty()) { return this.uriNavigations.getLast().isCollection(); } return this.uriResourceEntitySet != null && this.uriResourceEntitySet.isCollection(); }
public boolean isCollection() { if (!this.uriNavigations.isEmpty()) { return this.uriNavigations.getLast().isCollection(); } return this.uriResourceEntitySet != null && this.uriResourceEntitySet.isCollection(); }
private EdmBindingTarget getEntitySetFromNavigation(final EdmBindingTarget lastFoundEntitySetOrSingleton, final UriResourceNavigation uriResourceNavigation) { if (lastFoundEntitySetOrSingleton != null && !uriResourceNavigation.isCollection()) { EdmNavigationProperty navProp = uriResourceNavigation.getProperty(); return lastFoundEntitySetOrSingleton.getRelatedBindingTarget(navProp.getName()); } return null; } }
private EdmBindingTarget getEntitySetFromNavigation(final EdmBindingTarget lastFoundEntitySetOrSingleton, final UriResourceNavigation uriResourceNavigation) { if (lastFoundEntitySetOrSingleton != null && !uriResourceNavigation.isCollection()) { EdmNavigationProperty navProp = uriResourceNavigation.getProperty(); return lastFoundEntitySetOrSingleton.getRelatedBindingTarget(navProp.getName()); } return null; } }
@Override public boolean assertHttpMethod(ODataResponse response) throws ODataHandlerException { if ((isGET() || isDELETE()) && getReturnRepresentation() != ReturnRepresentation.NONE) { return methodNotAllowed(response, httpMethod(), "Invalid Prefer header used", allowedMethods()); } // references are only allowed on the navigation properties if (getNavigations().isEmpty()) { return methodNotAllowed(response, httpMethod(), "References can be only used on navigation properties", allowedMethods()); } // 11.4.6.1 - post allowed on only collection valued navigation if (isPOST() && !getNavigations().getLast().isCollection()) { return methodNotAllowed(response, httpMethod(), "POST only allowed on collection valued navigation", allowedMethods()); } // 11.4.6.3 - PUT allowed on single valued navigation if (isPUT() && getNavigations().getLast().isCollection()) { return methodNotAllowed(response, httpMethod(), "PUT only allowed on single valued navigation", allowedMethods()); } //PATCH is not defined in spec return ServiceRequest.assertHttpMethod(httpMethod(), allowedMethods(), response); }
@Override public boolean assertHttpMethod(ODataResponse response) throws ODataHandlerException { if ((isGET() || isDELETE()) && getReturnRepresentation() != ReturnRepresentation.NONE) { return methodNotAllowed(response, httpMethod(), "Invalid Prefer header used", allowedMethods()); } // references are only allowed on the navigation properties if (getNavigations().isEmpty()) { return methodNotAllowed(response, httpMethod(), "References can be only used on navigation properties", allowedMethods()); } // 11.4.6.1 - post allowed on only collection valued navigation if (isPOST() && !getNavigations().getLast().isCollection()) { return methodNotAllowed(response, httpMethod(), "POST only allowed on collection valued navigation", allowedMethods()); } // 11.4.6.3 - PUT allowed on single valued navigation if (isPUT() && getNavigations().getLast().isCollection()) { return methodNotAllowed(response, httpMethod(), "PUT only allowed on single valued navigation", allowedMethods()); } //PATCH is not defined in spec return ServiceRequest.assertHttpMethod(httpMethod(), allowedMethods(), response); }
eInfo.setParententityName(currentUri.toString()); eInfo.setIscollection(uriRN.isCollection());
eInfo.setParententityName(currentUri.toString()); eInfo.setIscollection(uriRN.isCollection()); prepareFilterForKeyPredicatesNavigation(uriRN.getKeyPredicates(), entity,eInfo);
eInfo.setParententityName(currentUri.toString()); eInfo.setIscollection(uriRN.isCollection());
if (nav.isCollection()) { entitySet = getNavigableEntitySet(this.serviceMetadata, entity, nav.getProperty(), baseURL); } else {