From 4013246d75a7af59e68f85f0871a9a8b0ecb2290 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sat, 1 Jun 2024 11:19:14 +0200 Subject: [PATCH] remove SQLLoadable and SQLLoadableCollection and some obsolete related code Signed-off-by: Gavin King --- .../internal/MappingModelCreationHelper.java | 4 +- .../AbstractCollectionPersister.java | 19 ------- .../collection/DeprecatedCollectionStuff.java | 6 +-- .../collection/QueryableCollection.java | 15 ++---- .../collection/SQLLoadableCollection.java | 17 ------- .../entity/AbstractEntityPersister.java | 51 ------------------- .../entity/DeprecatedEntityStuff.java | 2 +- .../hibernate/persister/entity/Loadable.java | 19 +++---- .../persister/entity/SQLLoadable.java | 43 ---------------- .../entity/UnionSubclassEntityPersister.java | 5 -- .../internal/ResultSetMappingProcessor.java | 40 +++++++-------- .../query/sql/internal/SQLQueryParser.java | 12 ++--- 12 files changed, 41 insertions(+), 192 deletions(-) delete mode 100644 hibernate-core/src/main/java/org/hibernate/persister/collection/SQLLoadableCollection.java delete mode 100644 hibernate-core/src/main/java/org/hibernate/persister/entity/SQLLoadable.java diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java index 0d9d96459a..b506183df3 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java @@ -81,7 +81,6 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.persister.collection.AbstractCollectionPersister; import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.QueryableCollection; -import org.hibernate.persister.collection.SQLLoadableCollection; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.Joinable; import org.hibernate.property.access.internal.ChainedPropertyAccessImpl; @@ -565,8 +564,7 @@ public class MappingModelCreationHelper { indexDescriptor = null; - assert collectionDescriptor instanceof SQLLoadableCollection; - final SQLLoadableCollection loadableCollection = (SQLLoadableCollection) collectionDescriptor; + final QueryableCollection loadableCollection = (QueryableCollection) collectionDescriptor; final String identifierColumnName = loadableCollection.getIdentifierColumnName(); assert identifierColumnName != null; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java index a019f9937b..bae0a6277e 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java @@ -26,7 +26,6 @@ import org.hibernate.Internal; import org.hibernate.LockOptions; import org.hibernate.MappingException; import org.hibernate.QueryException; -import org.hibernate.Remove; import org.hibernate.TransientObjectException; import org.hibernate.annotations.CacheLayout; import org.hibernate.boot.spi.MetadataImplementor; @@ -871,24 +870,6 @@ public abstract class AbstractCollectionPersister protected abstract RowMutationOperations getRowMutationOperations(); protected abstract RemoveCoordinator getRemoveCoordinator(); - @Override - public String getSQLOrderByString(String alias) { - if ( hasOrdering() ) { - throw new UnsupportedOperationException(); - } - - return ""; - } - - @Override - public String getManyToManyOrderByString(String alias) { - if ( hasManyToManyOrdering() ) { - throw new UnsupportedOperationException(); - } - - return ""; - } - @Override public FetchMode getFetchMode() { return fetchMode; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/DeprecatedCollectionStuff.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/DeprecatedCollectionStuff.java index 6963fde1e8..d01e626e08 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/DeprecatedCollectionStuff.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/DeprecatedCollectionStuff.java @@ -10,9 +10,5 @@ package org.hibernate.persister.collection; * @deprecated Just used to singly extend all the deprecated collection persister roles */ @Deprecated -public interface DeprecatedCollectionStuff extends SQLLoadableCollection { - @Override - default String getRole() { - return SQLLoadableCollection.super.getRole(); - } +public interface DeprecatedCollectionStuff extends QueryableCollection { } diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/QueryableCollection.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/QueryableCollection.java index d76e795598..98d569394c 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/QueryableCollection.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/QueryableCollection.java @@ -53,18 +53,10 @@ public interface QueryableCollection extends PropertyMapping, Joinable, Collecti * key columns in the case of a one-to-many association) */ String[] getElementColumnNames(); - /** - * Get the order by SQL - */ - String getSQLOrderByString(String alias); - /** - * Get the order-by to be applied at the target table of a many to many - * - * @param alias The alias for the many-to-many target table - * @return appropriate order-by fragment or empty string. - */ - String getManyToManyOrderByString(String alias); + String getIdentifierColumnName(); + + String[] getCollectionPropertyColumnAliases(String propertyName, String string); /** * Does this collection role have a where clause filter? @@ -81,5 +73,4 @@ public interface QueryableCollection extends PropertyMapping, Joinable, Collecti * Should we load this collection role by outerjoining? */ FetchMode getFetchMode(); - } diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/SQLLoadableCollection.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/SQLLoadableCollection.java deleted file mode 100644 index cd166ecb1f..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/SQLLoadableCollection.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later. - * See the lgpl.txt file in the root directory or . - */ -package org.hibernate.persister.collection; - - -@Deprecated( since = "6" ) -public interface SQLLoadableCollection extends QueryableCollection { - - String[] getCollectionPropertyColumnAliases(String propertyName, String string); - - String getIdentifierColumnName(); - -} diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index 98acf9bb2e..f5b22d3cea 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -78,7 +78,6 @@ import org.hibernate.engine.internal.CacheHelper; import org.hibernate.engine.internal.ImmutableEntityEntryFactory; import org.hibernate.engine.internal.MutableEntityEntryFactory; import org.hibernate.engine.internal.StatefulPersistenceContext; -import org.hibernate.engine.jdbc.mutation.spi.MutationExecutorService; import org.hibernate.engine.jdbc.spi.JdbcCoordinator; import org.hibernate.engine.profile.internal.FetchProfileAffectee; import org.hibernate.engine.spi.CachedNaturalIdValueSource; @@ -237,7 +236,6 @@ import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategyProvide import org.hibernate.service.ServiceRegistry; import org.hibernate.spi.NavigablePath; import org.hibernate.sql.Alias; -import org.hibernate.sql.Delete; import org.hibernate.sql.InFragment; import org.hibernate.sql.SimpleSelect; import org.hibernate.sql.Template; @@ -308,7 +306,6 @@ import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttrib import static org.hibernate.engine.internal.ManagedTypeHelper.processIfManagedEntity; import static org.hibernate.engine.internal.ManagedTypeHelper.processIfPersistentAttributeInterceptable; import static org.hibernate.engine.internal.ManagedTypeHelper.processIfSelfDirtinessTracker; -import static org.hibernate.engine.internal.Versioning.isVersionIncrementRequired; import static org.hibernate.generator.EventType.INSERT; import static org.hibernate.generator.EventType.UPDATE; import static org.hibernate.internal.util.ReflectHelper.isAbstractClass; @@ -324,7 +321,6 @@ import static org.hibernate.internal.util.collections.ArrayHelper.toTypeArray; import static org.hibernate.internal.util.collections.CollectionHelper.combine; import static org.hibernate.internal.util.collections.CollectionHelper.isNotEmpty; import static org.hibernate.internal.util.collections.CollectionHelper.setOfSize; -import static org.hibernate.internal.util.collections.CollectionHelper.toSmallList; import static org.hibernate.loader.ast.internal.MultiKeyLoadHelper.supportsSqlArrayType; import static org.hibernate.metamodel.RepresentationMode.POJO; import static org.hibernate.persister.entity.DiscriminatorHelper.NOT_NULL_DISCRIMINATOR; @@ -386,8 +382,6 @@ public abstract class AbstractEntityPersister private final boolean[][] propertyColumnInsertable; private final Set sharedColumnNames; - private final List lobProperties; - //information about lazy properties of this class private final String[] lazyPropertyNames; private final int[] lazyPropertyNumbers; @@ -443,10 +437,6 @@ public abstract class AbstractEntityPersister private GeneratedValuesMutationDelegate updateDelegate; private String identitySelectString; - private boolean[] tableHasColumns; - - private final Map subclassPropertyColumnNames = new HashMap<>(); - private final JavaType javaType; private final EntityRepresentationStrategy representationStrategy; @@ -648,7 +638,6 @@ public abstract class AbstractEntityPersister final ArrayList lazyTypes = new ArrayList<>(); final ArrayList lazyColAliases = new ArrayList<>(); - final ArrayList lobPropertiesLocalCollector = new ArrayList<>(); final List propertyClosure = persistentClass.getPropertyClosure(); boolean foundFormula = false; for ( int i = 0; i < propertyClosure.size(); i++ ) { @@ -709,12 +698,7 @@ public abstract class AbstractEntityPersister propertyColumnUpdateable[i] = prop.getValue().getColumnUpdateability(); propertyColumnInsertable[i] = prop.getValue().getColumnInsertability(); - - if ( prop.isLob() && dialect.forceLobAsLastValue() ) { - lobPropertiesLocalCollector.add( i ); - } } - lobProperties = toSmallList( lobPropertiesLocalCollector ); hasFormulaProperties = foundFormula; lazyPropertyColumnAliases = to2DStringArray( lazyColAliases ); lazyPropertyNames = toStringArray( lazyNames ); @@ -1083,10 +1067,6 @@ public abstract class AbstractEntityPersister return sharedColumnNames.contains( columnExpression ); } - protected boolean[] getTableHasColumns() { - return tableHasColumns; - } - @Override public String[] getRootTableKeyColumnNames() { return rootTableKeyColumnNames; @@ -2648,12 +2628,6 @@ public abstract class AbstractEntityPersister ); } - @Override - public String[] getSubclassPropertyColumnNames(String propertyName) { - //TODO: should we allow suffixes on these ? - return subclassPropertyColumnNames.get( propertyName ); - } - @Override public Object loadByUniqueKey( String propertyName, @@ -3439,13 +3413,6 @@ public abstract class AbstractEntityPersister final int joinSpan = getTableSpan(); - tableHasColumns = new boolean[joinSpan]; - for ( int j = 0; j < joinSpan; j++ ) { - final String tableName = getTableName( j ); - final EntityTableMapping tableMapping = findTableMapping( tableName ); - tableHasColumns[j] = tableMapping.hasColumns(); - } - //select SQL sqlVersionSelectString = generateSelectVersionString(); } @@ -4313,11 +4280,6 @@ public abstract class AbstractEntityPersister return propertyMapping.toType( propertyName ); } - @Override - public Type getType() { - return entityMetamodel.getEntityType(); - } - @Override public boolean isSelectBeforeUpdateRequired() { return entityMetamodel.isSelectBeforeUpdate(); @@ -6423,13 +6385,11 @@ public abstract class AbstractEntityPersister // aliases for identifier ( alias.id ); skip if the entity defines a non-id property named 'id' if ( !entityMetamodel.hasNonIdentifierPropertyNamedId() ) { subclassPropertyAliases.put( ENTITY_ID, getIdentifierAliases() ); - subclassPropertyColumnNames.put( ENTITY_ID, getIdentifierColumnNames() ); } // aliases named identifier ( alias.idname ) if ( hasIdentifierProperty() ) { subclassPropertyAliases.put( getIdentifierPropertyName(), getIdentifierAliases() ); - subclassPropertyColumnNames.put( getIdentifierPropertyName(), getIdentifierColumnNames() ); } // aliases for composite-id's @@ -6446,10 +6406,6 @@ public abstract class AbstractEntityPersister ENTITY_ID + "." + idPropertyNames[i], new String[] {idAliases[i]} ); - subclassPropertyColumnNames.put( - ENTITY_ID + "." + getIdentifierPropertyName() + "." + idPropertyNames[i], - new String[] {idColumnNames[i]} - ); } // if (hasIdentifierProperty() && !ENTITY_ID.equals( getIdentifierPropertyNames() ) ) { if ( hasIdentifierProperty() ) { @@ -6457,22 +6413,16 @@ public abstract class AbstractEntityPersister getIdentifierPropertyName() + "." + idPropertyNames[i], new String[] {idAliases[i]} ); - subclassPropertyColumnNames.put( - getIdentifierPropertyName() + "." + idPropertyNames[i], - new String[] {idColumnNames[i]} - ); } else { // embedded composite ids ( alias.idName1, alias.idName2 ) subclassPropertyAliases.put( idPropertyNames[i], new String[] {idAliases[i]} ); - subclassPropertyColumnNames.put( idPropertyNames[i], new String[] {idColumnNames[i]} ); } } } if ( entityMetamodel.isPolymorphic() ) { subclassPropertyAliases.put( ENTITY_CLASS, new String[] {getDiscriminatorAlias()} ); - subclassPropertyColumnNames.put( ENTITY_CLASS, new String[] {getDiscriminatorColumnName()} ); } } @@ -6496,7 +6446,6 @@ public abstract class AbstractEntityPersister } subclassPropertyAliases.put( name, aliases ); - subclassPropertyColumnNames.put( name, cols ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/DeprecatedEntityStuff.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/DeprecatedEntityStuff.java index c7c51dbfee..58e58b629b 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/DeprecatedEntityStuff.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/DeprecatedEntityStuff.java @@ -12,5 +12,5 @@ package org.hibernate.persister.entity; */ @Deprecated public interface DeprecatedEntityStuff - extends OuterJoinLoadable, UniqueKeyLoadable, SQLLoadable, Lockable, Queryable { + extends OuterJoinLoadable, UniqueKeyLoadable, Loadable, Lockable, Queryable { } diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/Loadable.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/Loadable.java index 318f0fe560..f3f8217e74 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/Loadable.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/Loadable.java @@ -92,15 +92,6 @@ public interface Loadable extends EntityPersister { boolean isAbstract(); - /** - * Register the name of a fetch profile determined to have an affect on the - * underlying loadable in regards to the fact that the underlying load SQL - * needs to be adjust when the given fetch profile is enabled. - * - * @param fetchProfileName The name of the profile affecting this. - */ - void registerAffectingFetchProfile(String fetchProfileName); - /** * Given a column name and the root table alias in use for the entity hierarchy, determine the proper table alias * for the table in that hierarchy that contains said column. @@ -114,4 +105,14 @@ public interface Loadable extends EntityPersister { * @return The proper table alias for qualifying the given column. */ String getTableAliasForColumn(String columnName, String rootAlias); + + /** + * All columns to select, when loading. + */ + String selectFragment(String alias, String suffix); + + /** + * Return the column alias names used to persist/query the named property of the class or a subclass (optional operation). + */ + String[] getSubclassPropertyColumnAliases(String propertyName, String suffix); } diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/SQLLoadable.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/SQLLoadable.java deleted file mode 100644 index e6a6b0ac11..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/SQLLoadable.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later. - * See the lgpl.txt file in the root directory or . - */ -package org.hibernate.persister.entity; - -import org.hibernate.metamodel.mapping.EntityMappingType; -import org.hibernate.type.Type; - -/** - * An {@link EntityPersister} that supports queries expressed - * in the platform native SQL dialect. - * - * @author Gavin King, Max Andersen - * - * @deprecated Use {@link EntityMappingType} - */ -@Deprecated(since = "6", forRemoval = true) -public interface SQLLoadable extends Loadable { - - /** - * Return the column alias names used to persist/query the named property of the class or a subclass (optional operation). - */ - String[] getSubclassPropertyColumnAliases(String propertyName, String suffix); - - /** - * Return the column names used to persist/query the named property of the class or a subclass (optional operation). - */ - String[] getSubclassPropertyColumnNames(String propertyName); - - /** - * All columns to select, when loading. - */ - String selectFragment(String alias, String suffix); - - /** - * Get the type - */ - Type getType(); - -} diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java index 5c180cdc4a..21b0271208 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java @@ -33,7 +33,6 @@ import org.hibernate.dialect.Dialect; import org.hibernate.id.IdentityGenerator; import org.hibernate.internal.FilterAliasGenerator; import org.hibernate.internal.StaticFilterAliasGenerator; -import org.hibernate.internal.util.collections.ArrayHelper; import org.hibernate.internal.util.collections.JoinedList; import org.hibernate.jdbc.Expectation; import org.hibernate.mapping.Column; @@ -446,10 +445,6 @@ public class UnionSubclassEntityPersister extends AbstractEntityPersister { return 1; } - protected boolean[] getTableHasColumns() { - return ArrayHelper.TRUE; - } - @Override protected int[] getPropertyTableNumbers() { return new int[getPropertySpan()]; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ResultSetMappingProcessor.java b/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ResultSetMappingProcessor.java index c051eb5646..58a0628354 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ResultSetMappingProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sql/internal/ResultSetMappingProcessor.java @@ -27,10 +27,8 @@ import org.hibernate.metamodel.mapping.CollectionPart; import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.QueryableCollection; -import org.hibernate.persister.collection.SQLLoadableCollection; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.Loadable; -import org.hibernate.persister.entity.SQLLoadable; import org.hibernate.query.NativeQuery; import org.hibernate.query.results.FetchBuilder; import org.hibernate.query.results.ResultSetMapping; @@ -236,7 +234,7 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { null, determineNavigablePath( fetchBuilder ) ); - final SQLLoadable loadable = (SQLLoadable) alias2Persister.get( fetchBuilder.getOwnerAlias() ); + final Loadable loadable = (Loadable) alias2Persister.get( fetchBuilder.getOwnerAlias() ); final List columnNames; final String[] columnAliases = loadable.getSubclassPropertyColumnAliases( fetchBuilder.getFetchableName(), @@ -308,7 +306,7 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { String suffix, LockMode lockMode, NavigablePath navigablePath) { - final SQLLoadable loadable = (SQLLoadable) entityMapping.getEntityPersister(); + final Loadable loadable = (Loadable) entityMapping.getEntityPersister(); final DynamicResultBuilderEntityStandard resultBuilderEntity = new DynamicResultBuilderEntityStandard( entityMapping, tableAlias, @@ -347,7 +345,7 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { private void addFetchBuilder( String suffix, - SQLLoadable loadable, + Loadable loadable, DynamicFetchBuilderContainer resultBuilderEntity, String tableAlias, String[] identifierAliases, @@ -441,14 +439,14 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { ); } - private SQLLoadable getSQLLoadable(String entityName) throws MappingException { + private Loadable getSQLLoadable(String entityName) throws MappingException { final EntityPersister entityDescriptor = factory.getRuntimeMetamodels() .getMappingMetamodel() .getEntityDescriptor( entityName ); - if ( !(entityDescriptor instanceof SQLLoadable) ) { - throw new MappingException( "class persister is not SQLLoadable: " + entityName ); + if ( !(entityDescriptor instanceof Loadable) ) { + throw new MappingException( "class persister is not Loadable: " + entityName ); } - return (SQLLoadable) entityDescriptor; + return (Loadable) entityDescriptor; } private String generateEntitySuffix() { @@ -501,12 +499,12 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { return; } - SQLLoadable persister = (SQLLoadable) rootReturn.getEntityMapping().getEntityPersister(); + Loadable persister = (Loadable) rootReturn.getEntityMapping().getEntityPersister(); Map propertyResultsMap = Collections.emptyMap();//rootReturn.getPropertyResultsMap() addPersister( rootReturn.getTableAlias(), propertyResultsMap, persister ); } - private void addPersister(String alias, Map propertyResult, SQLLoadable persister) { + private void addPersister(String alias, Map propertyResult, Loadable persister) { alias2Persister.put( alias, persister ); String suffix = generateEntitySuffix(); LOG.tracev( "Mapping alias [{0}] to entity-suffix [{1}]", alias, suffix ); @@ -516,9 +514,9 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { private void addCollection(String role, String alias, Map propertyResults) { - final SQLLoadableCollection collectionDescriptor = (SQLLoadableCollection) factory.getRuntimeMetamodels() - .getMappingMetamodel() - .getCollectionDescriptor( role ); + final QueryableCollection collectionDescriptor = (QueryableCollection) + factory.getRuntimeMetamodels().getMappingMetamodel() + .getCollectionDescriptor( role ); alias2CollectionPersister.put( alias, collectionDescriptor ); String suffix = generateCollectionSuffix(); @@ -527,7 +525,7 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { collectionPropertyResultMaps.put( alias, propertyResults ); if ( collectionDescriptor.isOneToMany() || collectionDescriptor.isManyToMany() ) { - SQLLoadable persister = ( SQLLoadable ) collectionDescriptor.getElementPersister(); + Loadable persister = (Loadable) collectionDescriptor.getElementPersister(); addPersister( alias, filter( propertyResults ), persister ); } } @@ -565,7 +563,7 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { processReturn( alias2Return.get( ownerAlias ) ); } - SQLLoadable ownerPersister = ( SQLLoadable ) alias2Persister.get( ownerAlias ); + Loadable ownerPersister = (Loadable) alias2Persister.get( ownerAlias ); Type returnType = ownerPersister.getPropertyType( fetchReturn.getFetchableName() ); if ( returnType.isCollectionType() ) { @@ -577,7 +575,7 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { else if ( returnType.isEntityType() ) { EntityType eType = ( EntityType ) returnType; String returnEntityName = eType.getAssociatedEntityName(); - SQLLoadable persister = getSQLLoadable( returnEntityName ); + Loadable persister = getSQLLoadable( returnEntityName ); Map propertyResultsMap = Collections.emptyMap();//fetchReturn.getPropertyResultsMap() addPersister( alias, propertyResultsMap, persister ); } @@ -594,13 +592,13 @@ public class ResultSetMappingProcessor implements SQLQueryParser.ParserContext { } @Override - public SQLLoadable getEntityPersister(String alias) { - return (SQLLoadable) alias2Persister.get( alias ); + public Loadable getEntityPersister(String alias) { + return (Loadable) alias2Persister.get( alias ); } @Override - public SQLLoadableCollection getCollectionPersister(String alias) { - return (SQLLoadableCollection) alias2CollectionPersister.get( alias ); + public QueryableCollection getCollectionPersister(String alias) { + return (QueryableCollection) alias2CollectionPersister.get( alias ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/query/sql/internal/SQLQueryParser.java b/hibernate-core/src/main/java/org/hibernate/query/sql/internal/SQLQueryParser.java index 801d04af67..714ec018b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sql/internal/SQLQueryParser.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sql/internal/SQLQueryParser.java @@ -13,8 +13,8 @@ import org.hibernate.boot.model.naming.Identifier; import org.hibernate.boot.model.relational.SqlStringGenerationContext; import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.persister.collection.SQLLoadableCollection; -import org.hibernate.persister.entity.SQLLoadable; +import org.hibernate.persister.collection.QueryableCollection; +import org.hibernate.persister.entity.Loadable; /** * Substitutes escape sequences of form {@code {alias}}, @@ -36,10 +36,10 @@ public class SQLQueryParser { public interface ParserContext { boolean isEntityAlias(String aliasName); - SQLLoadable getEntityPersister(String alias); + Loadable getEntityPersister(String alias); String getEntitySuffix(String alias); boolean isCollectionAlias(String aliasName); - SQLLoadableCollection getCollectionPersister(String alias); + QueryableCollection getCollectionPersister(String alias); String getCollectionSuffix(String alias); Map getPropertyResultsMap(String alias); } @@ -207,7 +207,7 @@ public class SQLQueryParser { String aliasName, String propertyName) { final Map fieldResults = context.getPropertyResultsMap( aliasName ); - final SQLLoadableCollection collectionPersister = context.getCollectionPersister( aliasName ); + final QueryableCollection collectionPersister = context.getCollectionPersister( aliasName ); final String collectionSuffix = context.getCollectionSuffix( aliasName ); switch ( propertyName ) { case "*": @@ -234,7 +234,7 @@ public class SQLQueryParser { private String resolveProperties(String aliasName, String propertyName) { final Map fieldResults = context.getPropertyResultsMap( aliasName ); - final SQLLoadable persister = context.getEntityPersister( aliasName ); + final Loadable persister = context.getEntityPersister( aliasName ); final String suffix = context.getEntitySuffix( aliasName ); if ( "*".equals( propertyName ) ) { if ( !fieldResults.isEmpty() ) {