0

We add the ORDER BY clause in criteria builder as bellow.

criteriaQuery.orderBy(criteriaBuilder.asc(request.get("name")), 
criteriaBuilder.asc(type.get("val")));

When we see the query it looks like

ORDER BY p.named.val

But we expect

ORDER BY p.name,d.val

In actual result the comma(,) is missing in between p.name and d.val.

Please suggest me whey that comma is not there?

We use javax CriteriaBuilder.

Java-Seekar
  • 1,720
  • 5
  • 30
  • 52
  • are both `name` and `val` present in the `multiselect` or `tuple` query? – melc Mar 06 '14 at 11:44
  • Both name and val are in the multiselect. – Java-Seekar Mar 06 '14 at 11:48
  • 1
    Do you get any exceptions? if you execute the output native query from cli or db tool does it execute? Try using `desc` for the first attribute and see how it behaves? what kind of output will you get? Trying to figure out if it is an output thing of the provider or it actually tries to execute this query. Which `jpa provider` are you using? in which application server? – melc Mar 06 '14 at 11:53

0 Answers0