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

   I'm trying to perform an update action in a single field using gorm data 
services through `grails.gorm.services.Query`. In the 
[documentation](http://gorm.grails.org/latest/hibernate/manual/index.html#_data_service_write_operations)
 I found an example very similar to my case of use
   
   ```
   @Query("update ${Book book} set ${book.title} = $newTitle where book.title = 
$oldTitle")
   Number updateTitle(String newTitle, String oldTitle)
   ```
   The code that I try is the following:
   
   ```
   @Query("update ${Activity activity} set ${activity.state} = $state where 
activity.id = $id")
   Activity updateState(final String state, final Serializable id)
   ```
   I am getting a query exception 
`org.grails.orm.hibernate.exceptions.GrailsQueryException` with the following 
caused by message
   
   `Invalid query [UPDATE anotherdemo.Activity as activity SET activity.state = 
:p0 WHERE activity.id = :p1] for domain class [anotherdemo.Activity]`
   
   
   Please visit this 
[link](https://github.com/ilmoralito/demo-app-for-updating-single-field) to a 
github repository with an example app that reproduces the issue
   
   ### Environment Information
   
   - **Operating System**: Ubuntu 16.04
   - **Grails Version:** 3.3.0.M2
   - **JDK Version:** Using java version 8u121
   
   Thanks for your time


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