You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Jason <ja...@foxmail.com> on 2014/11/26 09:49:01 UTC
Does olingo odata2 Library support "$select"
Hi, as the title mentioned, I'm using olingo odata2 library, and I am not sure if it supports "$select" expression as I could not find the documentation about this, the only thing I found is about $expand. Could anybody tell me how to support "$select"?
Re: Does olingo odata2 Library support "$select"
Posted by "Bolz, Michael" <mi...@sap.com>.
Hi,
yes, $select is supported but unfortunately there actual no documentation exists on the homepage.
Easiest way to support "$select" should be to use the UriParser to create the ExpandSelectTree which than is passed to the EntityProvider.write… method.
See code snippet below or even better the ListProcessor.readEntitySet(…) implementation in our reference scenario [1].
Kind regards,
Michael
final EntityProviderWriteProperties feedProperties = EntityProviderWriteProperties
.serviceRoot(context.getPathInfo().getServiceRoot())
.expandSelectTree(UriParser.createExpandSelectTree(uriInfo.getSelect(), uriInfo.getExpand()))
.build();
...
return EntityProvider.writeFeed(contentType, entitySet, values, feedProperties);
[1]: https://git-wip-us.apache.org/repos/asf?p=olingo-odata2.git;a=blob;f=odata2-lib/odata-ref/src/main/java/org/apache/olingo/odata2/ref/processor/ListsProcessor.java;h=86ae0cb8480a43a29fe7809ed01bf42a95144bfd;hb=7d80609cf1d024a35fb97588ba14e6acab29ff07
> On 26 Nov 2014, at 09:49, Jason <ja...@foxmail.com> wrote:
>
> Hi, as the title mentioned, I'm using olingo odata2 library, and I am not sure if it supports "$select" expression as I could not find the documentation about this, the only thing I found is about $expand. Could anybody tell me how to support "$select"?