|
Is it possible to use the where query to sort on multiple fields of a domain class?
If so, have any examples? Thanks! - Dean Del Ponte
|
|
On Jun 15, 2012, at 6:03 AM, Dean Del Ponte wrote: > Is it possible to use the where query to sort on multiple fields of a domain class? > > If so, have any examples? Are the docs not working for you? http://grails.org/doc/latest/guide/GORM.html#whereQueries They show a variety of examples of a two-field search (using Groovy concatenation operators between fields). - Gary --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
He said "sort", not "search" and the docs don't really show an example of it.
I think you can just call .order() on the DetachedCriteria object: MyObject.where {
someAttribute == "FOO" }.order("somethingFirst").order("somethingElse", "desc").list() -Aaron
On Fri, Jun 15, 2012 at 12:06 PM, Gary Affonso <[hidden email]> wrote:
|
|
On Jun 15, 2012, at 11:22 AM, Aaron Long wrote: > He said "sort", not "search" and the docs don't really show an example of it. Doh! Sorry about that. - Gary --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by longwa
Worked great! Thanks!
- Dean Del Ponte
On Fri, Jun 15, 2012 at 1:22 PM, Aaron Long <[hidden email]> wrote: He said "sort", not "search" and the docs don't really show an example of it. |
| Powered by Nabble | Edit this page |
