From e2baceb38205d249da8915aa4bb417a12d6f4cbd Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Thu, 19 Jan 2023 10:20:11 +0100 Subject: [PATCH] HHH-16059 Add getters and relax scopes extending CteInsertStrategy and CteMutationStrategy --- .../mutation/internal/cte/CteInsertStrategy.java | 12 ++++++++++++ .../mutation/internal/cte/CteMutationStrategy.java | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertStrategy.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertStrategy.java index 79ad2b1cf0..4aac6f4992 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertStrategy.java @@ -154,4 +154,16 @@ public class CteInsertStrategy implements SqmMultiTableInsertStrategy { DomainQueryExecutionContext context) { return new CteInsertHandler( entityCteTable, sqmInsertStatement, domainParameterXref, sessionFactory ).execute( context ); } + + protected EntityPersister getRootDescriptor() { + return rootDescriptor; + } + + protected SessionFactoryImplementor getSessionFactory() { + return sessionFactory; + } + + protected CteTable getEntityCteTable() { + return entityCteTable; + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteMutationStrategy.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteMutationStrategy.java index a1c9c97948..1a31b0f776 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteMutationStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteMutationStrategy.java @@ -106,7 +106,7 @@ public class CteMutationStrategy implements SqmMultiTableMutationStrategy { return new CteUpdateHandler( idCteTable, sqmUpdate, domainParameterXref, this, sessionFactory ).execute( context ); } - private void checkMatch(SqmDeleteOrUpdateStatement sqmStatement) { + protected void checkMatch(SqmDeleteOrUpdateStatement sqmStatement) { final String targetEntityName = sqmStatement.getTarget().getEntityName(); final EntityPersister targetEntityDescriptor = sessionFactory.getRuntimeMetamodels() .getMappingMetamodel() @@ -124,4 +124,16 @@ public class CteMutationStrategy implements SqmMultiTableMutationStrategy { } } + + protected EntityPersister getRootDescriptor() { + return rootDescriptor; + } + + protected SessionFactoryImplementor getSessionFactory() { + return sessionFactory; + } + + protected CteTable getIdCteTable() { + return idCteTable; + } }