def allLocations = Location.findAllByIdInList(locationArray, [sort: "name", order: "asc"])
Need help understanding why this does not work (using recent postgres):--Here is a query where I thought the OrderBy suffix would work but the generated SQL does not have an order by. Any insight on what happened here is greatly appreciated.def allLocations = Location.findAllByIdInListOrderBy(locationArray)Hibernate: /* criteria query */ select this_.id as id1_20_0_, ... this_.path as path8_20_0_, ... from location this_ where this_.id in ( ?, ?, ?, ?, ?, ? )
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-dev-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/5bb0c49b-087a-471d-9c9a-f47e94eeb926%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I believe you need to pass the sort field and order as parameters like the first example in the following docsdef allLocations = Location.findAllByIdInList(locationArray, [sort: "name", order: "asc"])
On Mon, Sep 25, 2017 at 12:53 PM, Paul C <pkc...@gmail.com> wrote:
Need help understanding why this does not work (using recent postgres):Here is a query where I thought the OrderBy suffix would work but the generated SQL does not have an order by. Any insight on what happened here is greatly appreciated.def allLocations = Location.findAllByIdInListOrderBy(locationArray)Hibernate: /* criteria query */ select this_.id as id1_20_0_, ... this_.path as path8_20_0_, ... from location this_ where this_.id in ( ?, ?, ?, ?, ?, ? )
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.