private void checkCount() throws UriSyntaxException { if ("$count".equals(currentPathSegment)) { if (pathSegments.isEmpty()) { uriResult.setCount(true); } else { throw new UriSyntaxException(UriSyntaxException.MUSTBELASTSEGMENT.addContent(currentPathSegment)); } } }
private void checkCount() throws UriSyntaxException { if ("$count".equals(percentDecode(currentPathSegment))) { if (pathSegments.isEmpty()) { uriResult.setCount(true); } else { throw new UriSyntaxException(UriSyntaxException.MUSTBELASTSEGMENT.addContent(currentPathSegment)); } } }
private void checkCount() throws UriSyntaxException { if ("$count".equals(percentDecode(currentPathSegment))) { if (pathSegments.isEmpty()) { uriResult.setCount(true); } else { throw new UriSyntaxException(UriSyntaxException.MUSTBELASTSEGMENT.addContent(currentPathSegment)); } } }
@Override public ODataResponse readEntitySet(final GetEntitySetUriInfo uriParserResultView, final String contentType) throws ODataException { ODataResponse oDataResponse = null; try { oDataJPAContext.setODataContext(getContext()); List<Object> jpaEntities = jpaProcessor.process(uriParserResultView); InlineCount inlineCount = uriParserResultView.getInlineCount(); if (inlineCount != null && inlineCount.equals(InlineCount.ALLPAGES)) { ((UriInfoImpl) uriParserResultView).setCount(true); responseBuilder.setCount(jpaProcessor.process((GetEntitySetCountUriInfo) uriParserResultView)); } if (uriParserResultView.isNew()) { oDataResponse = responseBuilder.build((GetEntityUriInfo)uriParserResultView, jpaEntities.get(0), contentType); } else { oDataResponse = responseBuilder.build(uriParserResultView, jpaEntities, contentType); } } finally { close(); } return oDataResponse; }