Skip to content

Commit

Permalink
HHH-14251 Invalid SQL for @Embedded UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 authored and Sanne committed Nov 30, 2020
1 parent 900da12 commit 9376650
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -9,6 +9,7 @@
import org.hibernate.QueryException;
import org.hibernate.engine.internal.JoinSequence;
import org.hibernate.hql.internal.CollectionProperties;
import org.hibernate.hql.internal.antlr.HqlSqlTokenTypes;
import org.hibernate.hql.internal.antlr.SqlTokenTypes;
import org.hibernate.hql.internal.ast.util.ASTUtil;
import org.hibernate.hql.internal.ast.util.ColumnHelper;
Expand Down Expand Up @@ -256,7 +257,7 @@ private void initText() {
boolean countDistinct = getWalker().isInCountDistinct()
&& getWalker().getSessionFactoryHelper().getFactory().getDialect().requiresParensForTupleDistinctCounts();
if ( cols.length > 1 &&
( getWalker().isComparativeExpressionClause() || countDistinct ) ) {
( getWalker().isComparativeExpressionClause() || countDistinct || getWalker().getCurrentClauseType() == HqlSqlTokenTypes.SET ) ) {
text = "(" + text + ")";
}
setText( text );
Expand Down

0 comments on commit 9376650

Please sign in to comment.