Execute sql statement in a button action

I want to execute update sql statement in a button action,how could I do it ?

Hi.
You can execute SQL queries using EntityManager. EntityManager is not available from the client.
So you should create a service (using Studio). Open it in the IDE, create a method. The required SQL statement can be executed by EntityManager.createNativeQuery() as it described in the documentation. Then, you can invoke created service method from the button click handler.

Thanks, Natalia.
If I want to update one column’s value of a table , can I execute update SQL by using EntityManager?