Dynamic finders with InList and OrderBy issue

Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic finders with InList and OrderBy issue

Paul C
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.  I thought it would at least cause an error if the context is not valid for OrderBy.  We are using several recent versions of postgres.


def allLocations = Location.findAllByIdInListOrderByPath(locationArray)

Notice hibernate sql does not have 'order by':

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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/2dc2724c-9f3a-4be8-8df3-db9c511cc6df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Dynamic finders with InList and OrderBy issue

David Estes
Remove the OrderBy and I believe you can pass a map as a method arg to the dynamic finder with properties sort and direction

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/79f05ce5-265a-4ae7-a912-8bcef2a621bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.