[JIRA] (HHH-16198) Fix up TableGroupJoinProducer, et.al.
by Steve Ebersole (JIRA)
Steve Ebersole ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNDA1MzE1YmVi... ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-16198?atlOrigin=eyJpIjoiNDA1Mz... ) HHH-16198 ( https://hibernate.atlassian.net/browse/HHH-16198?atlOrigin=eyJpIjoiNDA1Mz... ) Fix up TableGroupJoinProducer, et.al. ( https://hibernate.atlassian.net/browse/HHH-16198?atlOrigin=eyJpIjoiNDA1Mz... )
Change By: Steve Ebersole ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
A few contracts used during SQL AST creation define overloaded methods where one form accepts a {{SqlAstCreationState}} and is defined as {{default}} calling another form with values extracted from {{SqlAstCreationState}}. E.g.
{noformat}public interface TableGroupJoinProducer ... {
default TableGroupJoin createTableGroupJoin(
NavigablePath navigablePath,
TableGroup lhs,
String explicitSourceAlias,
SqlAstJoinType sqlAstJoinType,
boolean fetched,
boolean addsPredicate,
SqlAstCreationState creationState) {
return createTableGroupJoin(
navigablePath,
lhs,
explicitSourceAlias,
sqlAstJoinType,
fetched,
addsPredicate,
creationState.getSqlAliasBaseGenerator(),
creationState.getSqlExpressionResolver(),
creationState.getFromClauseAccess(),
creationState.getCreationContext()
);
}
TableGroupJoin createTableGroupJoin(
NavigablePath navigablePath,
TableGroup lhs,
String explicitSourceAlias,
SqlAstJoinType sqlAstJoinType,
boolean fetched,
boolean addsPredicate,
SqlAliasBaseGenerator aliasBaseGenerator,
SqlExpressionResolver sqlExpressionResolver,
FromClauseAccess fromClauseAccess,
SqlAstCreationContext creationContext);
}{noformat}
The problem is that in a few cases we actually need the {{SqlAstCreationState}} reference within the handling of these calls. A really bad habit I have seen in the code in these cases is to simply pass {{null}} for the {{SqlAstCreationState}} 😞
The “proper” fix would be to address this everywhere to always pass along the {{SqlAstCreationState}}, however that is likely to have a big impact. While all of the affected contracts are incubating we should still try to minimize changes.
( https://hibernate.atlassian.net/browse/HHH-16198#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16198#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100216- sha1:3fa9804 )
1 year, 10 months