gsartori commented on code in PR #15599:
URL: https://github.com/apache/grails-core/pull/15599#discussion_r3138427222


##########
grails-data-hibernate5/docs/src/docs/asciidoc/querying/whereQueries.adoc:
##########
@@ -262,42 +271,60 @@ Operator,Criteria Method,Description
 *<=*,sizeLe,The collection size is less than or equal to
 |===
 
-==== Query Aliases and Sorting
 
-If you define a query for an association an alias is automatically generated 
for the query. For example the following query:
+==== Sorting
+
+Sorting with `where` queries is performed by passing `sort` and (optionally) 
`order` arguments to the `list` method of a <<detachedCriteria,Detached 
Criteria>>.
+
+===== Single-field Sorting
+
+To sort by a single property:
 
 [source,groovy]
 ----
-def query = Pet.where {
-    owner.firstName == "Fred"
+def query = Person.where {
+    firstName == "Jack"
 }
+
+def results = query.list(sort: "firstName")
 ----
 
-Will generate an alias for the `owner` association such as `owner_alias_0`. 
These generated aliases are fine for most cases, but are not useful if you want 
to later sort or use a projection on the results. For example the following 
query will fail:
+By default, sorting is ascending. You can specify the direction explicitly 
using the `order` argument:

Review Comment:
   Understood but is that a real use case? It looks loike a disclosure of an 
inner working we dont need to know when quering. Or we need to explain it 
better like having a dedicated chapter?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to