How to use "nulls first"?

834 views
Skip to first unread message

(unbekannt)

unread,
Oct 30, 2013, 8:07:04 AM10/30/13
to quer...@googlegroups.com
Hi,

I'm using querydsl with postgres. The default behaviour of postgres is to use "NULLS last" on "sort asc". How can I use query dsl to set "NULLS FIRST"?

Thanks

Timo Westkämper

unread,
Oct 30, 2013, 8:28:20 AM10/30/13
to Querydsl on behalf of (unbekannt)
Hi.

Did you try

  query.orderBy(column.asc().nullsFirst())

Br,
Timo


--
You received this message because you are subscribed to the Google Groups "Querydsl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to querydsl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Timo Westkämper
Mysema Oy
+358 (0)40 591 2172
www.mysema.com


(unbekannt)

unread,
Oct 30, 2013, 8:48:59 AM10/30/13
to quer...@googlegroups.com
Thank you for your help.

I'm using Querydsl to create BooleanExpresions executed by a JPA repository.
My sorting looks like this:
PageRequest pageRequest = new PageRequest(0, 10, new Sort(Sort.Direction.ASC, "column")

So I'm using 
jparepository.findAll(booleanExpression, pageRequest);

Guess it's a problem with JPA ...

My sort  

Timo Westkämper

unread,
Nov 8, 2013, 2:55:57 PM11/8/13
to quer...@googlegroups.com
Hi.

This looks like a Spring Data sorting issue. It's easily done when Querydsl is directly used.

Timo
Reply all
Reply to author
Forward
0 new messages