HHH-14028 Change scope of various private methods to protected

So that Hibernate Reactive can reuse them.
This commit is contained in:
Davide D'Alto 2020-05-14 14:34:45 +01:00
parent 38d9f3738c
commit a862aed36c
4 changed files with 9 additions and 9 deletions

View File

@ -274,7 +274,7 @@ public class HQLQueryPlan implements Serializable {
* @return a reasonable size to use for allocation * @return a reasonable size to use for allocation
*/ */
@SuppressWarnings("UnnecessaryUnboxing") @SuppressWarnings("UnnecessaryUnboxing")
private int guessResultSize(RowSelection rowSelection) { protected int guessResultSize(RowSelection rowSelection) {
if ( rowSelection != null ) { if ( rowSelection != null ) {
final int maxReasonableAllocation = rowSelection.getFetchSize() != null ? rowSelection.getFetchSize().intValue() : 100; final int maxReasonableAllocation = rowSelection.getFetchSize() != null ? rowSelection.getFetchSize().intValue() : 100;
if ( rowSelection.getMaxRows() != null && rowSelection.getMaxRows().intValue() > 0 ) { if ( rowSelection.getMaxRows() != null && rowSelection.getMaxRows().intValue() > 0 ) {

View File

@ -314,7 +314,7 @@ public class QueryTranslatorImpl implements FilterTranslator {
} }
} }
private void errorIfDML() throws HibernateException { protected void errorIfDML() throws HibernateException {
if ( sqlAst.needsExecutor() ) { if ( sqlAst.needsExecutor() ) {
throw new QueryExecutionRequestException( "Not supported for DML operations", hql ); throw new QueryExecutionRequestException( "Not supported for DML operations", hql );
} }

View File

@ -2710,7 +2710,7 @@ public abstract class Loader {
return getResultList( result, queryParameters.getResultTransformer() ); return getResultList( result, queryParameters.getResultTransformer() );
} }
private QueryKey generateQueryKey( protected QueryKey generateQueryKey(
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
QueryParameters queryParameters) { QueryParameters queryParameters) {
return QueryKey.generateQueryKey( return QueryKey.generateQueryKey(
@ -2722,7 +2722,7 @@ public abstract class Loader {
); );
} }
private CacheableResultTransformer createCacheableResultTransformer(QueryParameters queryParameters) { protected CacheableResultTransformer createCacheableResultTransformer(QueryParameters queryParameters) {
return CacheableResultTransformer.create( return CacheableResultTransformer.create(
queryParameters.getResultTransformer(), queryParameters.getResultTransformer(),
getResultRowAliases(), getResultRowAliases(),
@ -2730,7 +2730,7 @@ public abstract class Loader {
); );
} }
private List getResultFromQueryCache( protected List getResultFromQueryCache(
final SharedSessionContractImplementor session, final SharedSessionContractImplementor session,
final QueryParameters queryParameters, final QueryParameters queryParameters,
final Set<Serializable> querySpaces, final Set<Serializable> querySpaces,
@ -2786,7 +2786,7 @@ public abstract class Loader {
return result; return result;
} }
private EntityPersister getEntityPersister(EntityType entityType) { protected EntityPersister getEntityPersister(EntityType entityType) {
return factory.getMetamodel().entityPersister( entityType.getAssociatedEntityName() ); return factory.getMetamodel().entityPersister( entityType.getAssociatedEntityName() );
} }

View File

@ -402,7 +402,7 @@ public class QueryLoader extends BasicLoader {
return true; return true;
} }
private boolean hasSelectNew() { protected boolean hasSelectNew() {
return aggregatedSelectExpression != null && aggregatedSelectExpression.getResultTransformer() != null; return aggregatedSelectExpression != null && aggregatedSelectExpression.getResultTransformer() != null;
} }
@ -487,7 +487,7 @@ public class QueryLoader extends BasicLoader {
} }
} }
private HolderInstantiator buildHolderInstantiator(ResultTransformer queryLocalResultTransformer) { protected HolderInstantiator buildHolderInstantiator(ResultTransformer queryLocalResultTransformer) {
final ResultTransformer implicitResultTransformer = aggregatedSelectExpression == null final ResultTransformer implicitResultTransformer = aggregatedSelectExpression == null
? null ? null
: aggregatedSelectExpression.getResultTransformer(); : aggregatedSelectExpression.getResultTransformer();
@ -506,7 +506,7 @@ public class QueryLoader extends BasicLoader {
return list( session, queryParameters, queryTranslator.getQuerySpaces(), queryReturnTypes ); return list( session, queryParameters, queryTranslator.getQuerySpaces(), queryReturnTypes );
} }
private void checkQuery(QueryParameters queryParameters) { protected void checkQuery(QueryParameters queryParameters) {
if ( hasSelectNew() && queryParameters.getResultTransformer() != null ) { if ( hasSelectNew() && queryParameters.getResultTransformer() != null ) {
throw new QueryException( "ResultTransformer is not allowed for 'select new' queries." ); throw new QueryException( "ResultTransformer is not allowed for 'select new' queries." );
} }