private static void blockTypeFilters(final UriResource uriResource,Locale locale) throws ODataApplicationException { if (uriResource instanceof UriResourceEntitySet && (((UriResourceEntitySet) uriResource).getTypeFilterOnCollection() != null || ((UriResourceEntitySet) uriResource).getTypeFilterOnEntry() != null) || uriResource instanceof UriResourceFunction && (((UriResourceFunction) uriResource).getTypeFilterOnCollection() != null || ((UriResourceFunction) uriResource).getTypeFilterOnEntry() != null) || uriResource instanceof UriResourceNavigation && (((UriResourceNavigation) uriResource).getTypeFilterOnCollection() != null || ((UriResourceNavigation) uriResource).getTypeFilterOnEntry() != null)) { getResourceLable(locale); throw new ODataApplicationException(labels.getString("TYPE_FILTERS_NOT_SUPPORTED"), HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), locale,labels.getString("TYPE_FILTERS_NOT_SUPPORTED_CODE")); } }
public static JPAAssociationPath determineAssoziationPath(final JPAServiceDocument sd, final UriResourcePartTyped naviStart, final StringBuilder associationName) throws ODataApplicationException { JPAEntityType naviStartType = null; try { if (naviStart instanceof UriResourceEntitySet) if (((UriResourceEntitySet) naviStart).getTypeFilterOnEntry() != null) naviStartType = sd.getEntity(((UriResourceEntitySet) naviStart).getTypeFilterOnEntry()); else naviStartType = sd.getEntity(((UriResourceEntitySet) naviStart).getType()); else if (naviStart instanceof UriResourceNavigation) if (((UriResourceNavigation) naviStart).getTypeFilterOnEntry() != null) naviStartType = sd.getEntity(((UriResourceNavigation) naviStart).getTypeFilterOnEntry()); else naviStartType = sd.getEntity(((UriResourceNavigation) naviStart).getProperty().getType()); JPAAssociationPath path = naviStartType == null ? null : naviStartType.getAssociationPath(associationName .toString()); if (path == null && naviStartType != null) { final JPACollectionAttribute collcetion = naviStartType.getCollectionAttribute(associationName.toString()); if (collcetion != null) path = collcetion.asAssociation(); } return path; } catch (ODataJPAModelException e) { throw new ODataJPAUtilException(ODataJPAUtilException.MessageKeys.UNKNOWN_NAVI_PROPERTY, HttpStatusCode.BAD_REQUEST); } }
private void blockTypeFilters(final UriResource uriResource) throws ODataApplicationException { if (uriResource instanceof UriResourceEntitySet && (((UriResourceEntitySet) uriResource).getTypeFilterOnCollection() != null || ((UriResourceEntitySet) uriResource).getTypeFilterOnEntry() != null) || uriResource instanceof UriResourceFunction && (((UriResourceFunction) uriResource).getTypeFilterOnCollection() != null || ((UriResourceFunction) uriResource).getTypeFilterOnEntry() != null) || uriResource instanceof UriResourceNavigation && (((UriResourceNavigation) uriResource).getTypeFilterOnCollection() != null || ((UriResourceNavigation) uriResource).getTypeFilterOnEntry() != null)) { throw new ODataApplicationException("Type filters are not supported.", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT); } }
putParameters(node, KEYS_NAME, ((UriResourceEntitySet) segment).getKeyPredicates()); putType(node, TYPE_FILTER_ON_COLLECTION_NAME, ((UriResourceEntitySet) segment).getTypeFilterOnCollection()); putType(node, TYPE_FILTER_ON_ENTRY_NAME, ((UriResourceEntitySet) segment).getTypeFilterOnEntry()); } else if (segment instanceof UriResourceNavigation) { putParameters(node, KEYS_NAME, ((UriResourceNavigation) segment).getKeyPredicates());
putParameters(node, KEYS_NAME, ((UriResourceEntitySet) segment).getKeyPredicates()); putType(node, TYPE_FILTER_ON_COLLECTION_NAME, ((UriResourceEntitySet) segment).getTypeFilterOnCollection()); putType(node, TYPE_FILTER_ON_ENTRY_NAME, ((UriResourceEntitySet) segment).getTypeFilterOnEntry()); } else if (segment instanceof UriResourceNavigation) { putParameters(node, KEYS_NAME, ((UriResourceNavigation) segment).getKeyPredicates());
appendParameters(gen, "keys", ((UriResourceEntitySet) resource).getKeyPredicates()); appendType(gen, "typeFilterOnCollection", ((UriResourceEntitySet) resource).getTypeFilterOnCollection()); appendType(gen, "typeFilterOnEntry", ((UriResourceEntitySet) resource).getTypeFilterOnEntry()); } else if (resource instanceof UriResourceNavigation) { appendParameters(gen, "keys", ((UriResourceNavigation) resource).getKeyPredicates());
appendParameters(gen, "keys", ((UriResourceEntitySet) resource).getKeyPredicates()); appendType(gen, "typeFilterOnCollection", ((UriResourceEntitySet) resource).getTypeFilterOnCollection()); appendType(gen, "typeFilterOnEntry", ((UriResourceEntitySet) resource).getTypeFilterOnEntry()); } else if (resource instanceof UriResourceNavigation) { appendParameters(gen, "keys", ((UriResourceNavigation) resource).getKeyPredicates());
castType = ((UriResourceNavigation) naviInfo.getUriResiource()).getTypeFilterOnEntry(); else castType = ((UriResourceEntitySet) naviInfo.getUriResiource()).getTypeFilterOnEntry(); if (castType != null) target = (From<?, ?>) target.as(sd.getEntity(castType.getFullQualifiedName()).getTypeClass());
if (contextType != null && ((lastSegment instanceof UriResourceEntitySet && (((UriResourceEntitySet) lastSegment).getTypeFilterOnCollection() != null || ((UriResourceEntitySet) lastSegment).getTypeFilterOnEntry() != null)) || contextUriInfo.getIdOption() != null) && contextType instanceof EdmEntityType) { contextUriInfo.setEntityTypeCast((EdmEntityType) contextType);
if (contextType != null && ((lastSegment instanceof UriResourceEntitySet && (((UriResourceEntitySet) lastSegment).getTypeFilterOnCollection() != null || ((UriResourceEntitySet) lastSegment).getTypeFilterOnEntry() != null)) || contextUriInfo.getIdOption() != null) && contextType instanceof EdmEntityType) { contextUriInfo.setEntityTypeCast((EdmEntityType) contextType);