turboDi opened a new issue, #14653:
URL: https://github.com/apache/grails-core/issues/14653

   Sort parmeter in param map for Criteria builder doesn't work the same way as 
in Dynamic Finders. In dynamic finder we could do this:
   
   ```
   Author.findAllByNameLike("A%", [sort: [name: "desc", id: "asc"]])
   ```
   
   If we try to do the same for Criteria builder or with Detached Criteria:
   
   ```
   Author.createCriteria().list(sort: [name: "desc", id: "asc"]) {
       like 'name', "A%"
   }
   ```
   
   The ClassCastException will be thrown:
   
   ```
   java.util.LinkedHashMap cannot be cast to java.lang.String. Stacktrace 
follows:
   Message: java.util.LinkedHashMap cannot be cast to java.lang.String
       Line | Method
   ->> 1615 | invokeMethod                          in 
org.grails.orm.hibernate.query.AbstractHibernateCriteriaBuilder
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   ```
   


-- 
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