Skip to content

HHH-19685 Rework multi-table handling code to allow caching and help Hibernate Reactive #10680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

beikov
Copy link
Member

@beikov beikov commented Jul 31, 2025

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19685

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Jul 31, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@@ -393,6 +464,26 @@
}
}

public static String createInsertedRowNumbersSelectSql(
TemporaryTable temporaryTable,
Function<SharedSessionContractImplementor, String> sessionUidAccess,

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'sessionUidAccess' is never used.
NamedTableReference targetTableReference,
Supplier<Consumer<SelectableConsumer>> tableKeyColumnVisitationSupplier,
SqlExpressionResolver sqlExpressionResolver,
TableGroup rootTableGroup,

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'rootTableGroup' is never used.
insertStatement.setSourceSelectStatement( querySpec );
applyAssignments( assignments, insertStatement, temporaryTableReference, getEntityDescriptor() );
final JdbcServices jdbcServices = getSessionFactory().getJdbcServices();
final SharedSessionContractImplementor session = executionContext.getSession();

Check notice

Code scanning / CodeQL

Unread local variable Note

Variable 'SharedSessionContractImplementor session' is never read.
return entityTable.getColumns().subList( startIndex, endIndex );
}

private void applyAssignments(List<Assignment> assignments, InsertSelectStatement insertStatement, NamedTableReference temporaryTableReference, EntityPersister entityDescriptor) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'entityDescriptor' is never used.
// generated values within the jdbc insert operaetion itself
final InsertGeneratedIdentifierDelegate identifierDelegate = (InsertGeneratedIdentifierDelegate) insertDelegate;
final ValueBinder jdbcValueBinder = basicIdentifierMapping.getJdbcMapping().getJdbcValueBinder();
for ( Map.Entry<Object, Object> entry : entityTableToRootIdentity.entrySet() ) {

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
entityTableToRootIdentity
may be null at this access because of
this
assignment.
@beikov beikov force-pushed the multi-table-refactor branch 5 times, most recently from 5ee29a6 to 5045fc2 Compare August 1, 2025 11:23
SqmJdbcExecutionContextAdapter executionContext) {
final QuerySpec idTableIdentifierSubQuery = ExecuteWithTemporaryTableHelper.createIdTableSelectQuerySpec(
getIdTable(),
sessionUidParameter,

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'predicateCollector' is never used.
@beikov beikov force-pushed the multi-table-refactor branch 3 times, most recently from b7cb358 to faf80dc Compare August 5, 2025 12:55
@sebersole
Copy link
Member

Since this has impact outside of just ORM we should have an associated Jira. I created one - https://hibernate.atlassian.net/browse/HHH-19685

I can update the commit messages if you want. I'll do that later today (and apply the PR) if you don't get to it.

…to allow caching and help Hibernate Reactive
@beikov beikov force-pushed the multi-table-refactor branch from a515763 to 08ee7ca Compare August 5, 2025 16:08
@beikov beikov changed the title Rework multi-table handling code to allow caching and help Hibernate Reactive HHH-19685 Rework multi-table handling code to allow caching and help Hibernate Reactive Aug 5, 2025
@beikov beikov merged commit fab70dd into hibernate:main Aug 5, 2025
21 of 23 checks passed
@beikov beikov deleted the multi-table-refactor branch August 5, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants