Hi
On 10/06/13 15:48, Kiril Gavrailov wrote:
Hi,
Ignoring the notation in the URL (since I do not know how exaclty will look
like) here's what I imagine:
/quotas?[orderColumn="columnName1",orderDirection="ASC";orderColumn="columnName2",orderDirection="ASC"....]

When I'm looking now at the url, I'm beginning to think that this would be
hardly possible. But I hope that you can figure some smart solution :)

Well, I'd consider trying a simple one:

public Somedata get(@QueryParam("column") List<String> column, @Default("asc") @QueryParam("direction") List<String> direction) {}

and expect both list have the same size, with the 1st position in the direction list corresponding to the 1st one in the column list, etc, and if the size of direction is less than that of the column one, the default to "asc" for the missing directions

Other option is experiment with "QueryParam("") ComplexQueryCriteria" where we'd have

class ComplexQueryCriteria {
Map<String, List<String>> columDirection;
}
and then do

"?columDirection.columnName1=asc&columDirection.columnName2=desc"

etc

HTH, Sergey
Regards,
Kiril


On Mon, Jun 10, 2013 at 5:42 PM, Sergey Beryozkin <[email protected]>wrote:

Hi

On 10/06/13 13:59, Kiril Gavrailov wrote:

Hi Guys,
I'm having the following case:
1. I have an object which i pass as a query param (which I use to tell my
backend what column in the table and how to order by the result I want)
annotated with QueryParam("") OrderCriteria orderCriteria which till now
worked just fine.
2. However I now have a case where I want to pass multiple POJOs of the
same type as query params, and I'm not finding any information on how to
do
that.
What I want to achieve is to have QueryParam("orderBy")
List<OrderCriteria>
orderCriterias;

Can you advise me what should I do?
And most importantly what url should I call, 'cause that's  the other
thing
I cannot figure out.

  How a query representing multiple order criteria may look like ?

Cheers, Sergey


  Big Thanks in advance,
Kiril







--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to