[hibernate/hibernate-orm] 6cf91c: HHH-12492 Test HQL Delete query with a subquery re...
by GitHub
Branch: refs/heads/5.3
Home: https://github.com/hibernate/hibernate-orm
Commit: 6cf91c832c71e23a951460b1daa23ce04e2ca9fd
https://github.com/hibernate/hibernate-orm/commit/6cf91c832c71e23a951460b...
Author: Yoann Rodière <yoann(a)hibernate.org>
Date: 2018-07-27 (Fri, 27 Jul 2018)
Changed paths:
A hibernate-core/src/test/java/org/hibernate/test/hql/DeleteQuerySubqueryReferencingTargetPropertyTest.java
Log Message:
-----------
HHH-12492 Test HQL Delete query with a subquery referencing the parent query's aliases
Commit: b8b7a0f19b2a32a436cedfd6c3632b3d9c0d7ac6
https://github.com/hibernate/hibernate-orm/commit/b8b7a0f19b2a32a436cedfd...
Author: Yoann Rodière <yoann(a)hibernate.org>
Date: 2018-07-27 (Fri, 27 Jul 2018)
Changed paths:
M hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElement.java
M hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java
M hibernate-core/src/test/java/org/hibernate/test/hql/DeleteQuerySubqueryReferencingTargetPropertyTest.java
Log Message:
-----------
HHH-12492 Qualify references to columns from the target table in subqueries in DELETE/UPDATE queries
Don't try to duplicate the logic from
org.hibernate.hql.internal.ast.tree.FromElementType#toColumns(java.lang.String, java.lang.String, boolean, boolean)
in other classes, it's complex enough and already seems to handle all
the cases we might encounter.
In this specific case, we want the table name to be used to qualify
column names, because the target table doesn't have any alias (it's not
supported by every version of every RDBMS), and not qualifying columns
at all may lead to a confusing statement, in particular if tables
referenced in the subquery contain columns with the same name.
Since we use aliases for every other table in the query, referencing the
table should not lead to any conflict.
Compare: https://github.com/hibernate/hibernate-orm/compare/77661b227581...b8b7a0f...
**NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
Functionality will be removed from GitHub.com on January 31st, 2019.
6 years, 4 months
[hibernate/hibernate-orm] 48f59e: HHH-12492 Test HQL Delete query with a subquery re...
by GitHub
Branch: refs/heads/master
Home: https://github.com/hibernate/hibernate-orm
Commit: 48f59e891fa0186bd8d2bd0e4b4ca5cdbf5bc3a0
https://github.com/hibernate/hibernate-orm/commit/48f59e891fa0186bd8d2bd0...
Author: Yoann Rodière <yoann(a)hibernate.org>
Date: 2018-07-27 (Fri, 27 Jul 2018)
Changed paths:
A hibernate-core/src/test/java/org/hibernate/test/hql/DeleteQuerySubqueryReferencingTargetPropertyTest.java
Log Message:
-----------
HHH-12492 Test HQL Delete query with a subquery referencing the parent query's aliases
Commit: dc42deafcb5267034f94b685a82f530d9c30a0af
https://github.com/hibernate/hibernate-orm/commit/dc42deafcb5267034f94b68...
Author: Yoann Rodière <yoann(a)hibernate.org>
Date: 2018-07-27 (Fri, 27 Jul 2018)
Changed paths:
M hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElement.java
M hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/IdentNode.java
M hibernate-core/src/test/java/org/hibernate/test/hql/DeleteQuerySubqueryReferencingTargetPropertyTest.java
Log Message:
-----------
HHH-12492 Qualify references to columns from the target table in subqueries in DELETE/UPDATE queries
Don't try to duplicate the logic from
org.hibernate.hql.internal.ast.tree.FromElementType#toColumns(java.lang.String, java.lang.String, boolean, boolean)
in other classes, it's complex enough and already seems to handle all
the cases we might encounter.
In this specific case, we want the table name to be used to qualify
column names, because the target table doesn't have any alias (it's not
supported by every version of every RDBMS), and not qualifying columns
at all may lead to a confusing statement, in particular if tables
referenced in the subquery contain columns with the same name.
Since we use aliases for every other table in the query, referencing the
table should not lead to any conflict.
Compare: https://github.com/hibernate/hibernate-orm/compare/036ea775dadc...dc42dea...
**NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
Functionality will be removed from GitHub.com on January 31st, 2019.
6 years, 4 months