Search code examples
eclipsehibernatehql

Updating a table using 'Eclipse HQL Editor' gives error


When I run the following query in Eclipse HQL editor, it doesn't work:

update TblAdmin A set A.password='1a23'

I get the error message:

org.hibernate.hql.QueryExecutionRequestException:Not supported for DML
operations[update TblAdmin A set A.password='1a23']

Other queries such as select statements are working fine.

Is there any option to execute the statement from the editor?


Solution

  • The eclipse HQL editor can't execute any manipulation statement (DML = Data Manipulation Language like UPDATE or DELETE).

    The editor was built to show a list of results for a query. But a DML update statement would just return one single integer, which would (beside the call of a different API method) require a different UI as well.