You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Madhawa Kasun Gunasekara <ma...@gmail.com> on 2015/09/14 10:07:20 UTC

[Olingo v4] How to process order by queries using service handler

Hi All,

I'm trying to process order by query, need to know, how to implement order
by query for my service, there are special interfaces for lambda , Literal,
Member and method.

How can I use those interface any help on this is highly appreciated.

Thanks,
Madhawa

Re: [Olingo v4] How to process order by queries using service handler

Posted by Ramesh Reddy <ra...@redhat.com>.
I am not sure I understand the "selectOption" handles by itself comment? T here are CountOption, ExpandOption .. for complete list take look at the " RequestURLHierarchyVisitor" class. You can use that to handle those options inside the service implementation if you want to, or just pick them off the request object. 

>>AFAIK we have to implement ourself on orderbyOption, FilterOption, SkipOption, TopOption 
Yes, the way ServiceHandler is designed to do is handle the OData protocol specific stuff, anything related to Service itself needs to be handled by the service developer. 

Ramesh.. 

----- Original Message -----

> Thanks Ramesh,

> BTW olingov4 handles selectOption by it self, what are the other query
> options that have been handle by olingo it self,
> AFAIK we have to implement ourself on orderbyOption, FilterOption,
> SkipOption, TopOption

> Thanks,
> Madhawa

> Madhawa

> On Mon, Sep 14, 2015 at 4:39 PM, Ramesh Reddy < rareddy@redhat.com > wrote:

> > Madhawa,
> 

> > For that you can take look at [1] and [2]. For an example, how to use it in
> > your service take look at an example [3].
> 

> > HTH
> 

> > Ramesh..
> 

> > [1]
> > https://github.com/apache/olingo-odata4/blob/master/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
> 
> > [2]
> > https://github.com/apache/olingo-odata4/blob/master/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/expression/ExpressionVisitorImpl.java
> 
> > [3]
> > https://github.com/apache/olingo-odata4/blob/master/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
> 

> > > Hi All,
> > 
> 

> > > I'm trying to process order by query, need to know, how to implement
> > > order
> > > by
> > > query for my service, there are special interfaces for lambda , Literal,
> > > Member and method.
> > 
> 

> > > How can I use those interface any help on this is highly appreciated.
> > 
> 

> > > Thanks,
> > 
> 
> > > Madhawa
> > 
> 

RE: [Olingo v4] How to process order by queries using service handler

Posted by Frédéric SOUCHU <Fr...@ingenico.com>.
Correct – that's the difficult part.
You have to convert the various xxxOption into a set of properties that your database layer understand.
Supporting a basic factory to route the correct request to the right table/view is easy.
Supporting OData type cast, inner joins and the like is another league…

Regards,
Frederic

From: Madhawa Kasun Gunasekara [mailto:madhawa30@gmail.com]
Sent: 15 September 2015 10:40
To: user@olingo.apache.org
Subject: Re: [Olingo v4] How to process order by queries using service handler

Thanks Ramesh,
BTW olingov4 handles selectOption by it self, what are the other query options that have been handle by olingo it self,
AFAIK we have to implement ourself on orderbyOption, FilterOption, SkipOption, TopOption
Thanks,
Madhawa

Madhawa

On Mon, Sep 14, 2015 at 4:39 PM, Ramesh Reddy <ra...@redhat.com>> wrote:
Madhawa,

For that you can take look at [1] and [2]. For an example, how to use it in your service take look at an example [3].

HTH

Ramesh..

[1] https://github.com/apache/olingo-odata4/blob/master/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
[2] https://github.com/apache/olingo-odata4/blob/master/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/expression/ExpressionVisitorImpl.java
[3] https://github.com/apache/olingo-odata4/blob/master/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java


________________________________
Hi All,

I'm trying to process order by query, need to know, how to implement order by query for my service, there are special interfaces for lambda , Literal, Member and method.

How can I use those interface any help on this is highly appreciated.

Thanks,
Madhawa



Re: [Olingo v4] How to process order by queries using service handler

Posted by Madhawa Kasun Gunasekara <ma...@gmail.com>.
Thanks Ramesh,

BTW olingov4 handles selectOption by it self, what are the other query
options that have been handle by olingo it self,
AFAIK we have to implement ourself on orderbyOption, FilterOption,
SkipOption, TopOption

Thanks,
Madhawa

Madhawa

On Mon, Sep 14, 2015 at 4:39 PM, Ramesh Reddy <ra...@redhat.com> wrote:

> Madhawa,
>
> For that you can take look at [1] and [2]. For an example, how to use it
> in your service take look at an example [3].
>
> HTH
>
> Ramesh..
>
> [1]
> https://github.com/apache/olingo-odata4/blob/master/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
> [2]
> https://github.com/apache/olingo-odata4/blob/master/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/expression/ExpressionVisitorImpl.java
> [3]
> https://github.com/apache/olingo-odata4/blob/master/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
>
>
> ------------------------------
>
> Hi All,
>
> I'm trying to process order by query, need to know, how to implement order
> by query for my service, there are special interfaces for lambda , Literal,
> Member and method.
>
> How can I use those interface any help on this is highly appreciated.
>
> Thanks,
> Madhawa
>
>
>

Re: [Olingo v4] How to process order by queries using service handler

Posted by Ramesh Reddy <ra...@redhat.com>.
Madhawa, 

For that you can take look at [1] and [2]. For an example, how to use it in your service take look at an example [3]. 

HTH 

Ramesh.. 

[1] https://github.com/apache/olingo-odata4/blob/master/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java 
[2] https://github.com/apache/olingo-odata4/blob/master/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/expression/ExpressionVisitorImpl.java 
[3] https://github.com/apache/olingo-odata4/blob/master/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java 

----- Original Message -----

> Hi All,

> I'm trying to process order by query, need to know, how to implement order by
> query for my service, there are special interfaces for lambda , Literal,
> Member and method.

> How can I use those interface any help on this is highly appreciated.

> Thanks,
> Madhawa