I traced it as far as org.hibernate.hql.internal.ast.tree.FromElementType#toColumns where this code block is executed when there's a where clause, which is what adds the table alias to the version fragment:
if ( isManipulationQuery() && isMultiTable() && inWhereClause() ) {
// the actual where-clause will end up being ripped out the update/delete and used in
// a select to populate the temp table, so its ok to use the table alias to qualify the table refs
// and safer to do so to protect from same-named columns
return propertyMapping.toColumns( tableAlias, path );
}
Doing a batch update such as {{update versioned Animal set weight = 69 where weight = 0}} generates a SQLGrammarException.
{code} org.hibernate.exception.SQLGrammarException: could not prepare statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) at org.hibernate.exception.internal.St...
This message was sent by Atlassian JIRA (v6.1-OD-09-WN#6144-sha1:62dfc48)