diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java index 3660c55eb1..d8707c6b89 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java @@ -458,6 +458,18 @@ public class QueryTranslatorImpl implements FilterTranslator { return statementExecutor.execute( queryParameters, session ); } + /** + * The SQl statements used for an update query. + * Throws exception if the query is a SELECT. + * @see #getSQLString() + * @throws QueryExecutionRequestException for select queries. + * @return the sql queries used for the update + */ + protected String[] getSqlStatements() { + errorIfSelect(); + return statementExecutor.getSqlStatements(); + } + /** * The SQL query string to be called; implemented by all subclasses */