subselect is ignored in EntityLoader

Description

subselect annotations are not respected in most of my domain tree and after some debugging seems i can see the cause: when using SessionImpl.get(...), eventualy EntityLoader.isSubselectLoadingEnabled() is being called but since it is not being overriden within EntityLoader the default implementation of Loader is called and return false what seems to me as wrong, stacktrace (sources: 5.0.9.Final) can be seen below.

EntityLoader(Loader).isSubselectLoadingEnabled() line: 1006
EntityLoader(Loader).processResultSet(ResultSet, QueryParameters, SessionImplementor, boolean, ResultTransformer, int, List<AfterLoadAction>) line: 958
EntityLoader(Loader).doQuery(SessionImplementor, QueryParameters, boolean, ResultTransformer) line: 930
EntityLoader(Loader).doQueryAndInitializeNonLazyCollections(SessionImplementor, QueryParameters, boolean, ResultTransformer) line: 336
EntityLoader(Loader).doQueryAndInitializeNonLazyCollections(SessionImplementor, QueryParameters, boolean) line: 306
EntityLoader(Loader).loadEntity(SessionImplementor, Object, Type, Object, String, Serializable, EntityPersister, LockOptions) line: 2204
EntityLoader(AbstractEntityLoader).load(SessionImplementor, Object, Object, Serializable, LockOptions) line: 60
EntityLoader.loadByUniqueKey(SessionImplementor, Object) line: 143
SingleTableEntityPersister(AbstractEntityPersister).loadByUniqueKey(String, Object, SessionImplementor) line: 2111
OneToOneType(EntityType).loadByUniqueKey(String, String, Object, SessionImplementor) line: 685
OneToOneType(EntityType).resolve(Object, SessionImplementor, Object) line: 427
TwoPhaseLoad.doInitializeEntity(Object, EntityEntry, boolean, SessionImplementor, PreLoadEvent) line: 154
TwoPhaseLoad.initializeEntity(Object, boolean, SessionImplementor, PreLoadEvent) line: 128
EntityLoadQueryDetails$EntityLoaderRowReader(AbstractRowReader).performTwoPhaseLoad(PreLoadEvent, ResultSetProcessingContextImpl, List<HydratedEntityRegistration>) line: 238
EntityLoadQueryDetails$EntityLoaderRowReader(AbstractRowReader).finishUp(ResultSetProcessingContextImpl, List<AfterLoadAction>) line: 209
ResultSetProcessorImpl.extractResults(ResultSet, SessionImplementor, QueryParameters, NamedParameterContext, boolean, boolean, ResultTransformer, List<AfterLoadAction>) line: 123
EntityLoader(AbstractLoadPlanBasedLoader).executeLoad(SessionImplementor, QueryParameters, LoadQueryDetails, boolean, ResultTransformer, List<AfterLoadAction>) line: 122
EntityLoader(AbstractLoadPlanBasedLoader).executeLoad(SessionImplementor, QueryParameters, LoadQueryDetails, boolean, ResultTransformer) line: 86
EntityLoader(AbstractLoadPlanBasedEntityLoader).load(Serializable, Object, SessionImplementor, LockOptions) line: 167
SingleTableEntityPersister(AbstractEntityPersister).load(Serializable, Object, LockOptions, SessionImplementor) line: 3956
DefaultLoadEventListener.loadFromDatasource(LoadEvent, EntityPersister) line: 508
DefaultLoadEventListener.doLoad(LoadEvent, EntityPersister, EntityKey, LoadEventListener$LoadType) line: 478
DefaultLoadEventListener.load(LoadEvent, EntityPersister, EntityKey, LoadEventListener$LoadType) line: 219
DefaultLoadEventListener.proxyOrLoad(LoadEvent, EntityPersister, EntityKey, LoadEventListener$LoadType) line: 278
DefaultLoadEventListener.doOnLoad(EntityPersister, LoadEvent, LoadEventListener$LoadType) line: 121
DefaultLoadEventListener.onLoad(LoadEvent, LoadEventListener$LoadType) line: 89
SessionImpl.fireLoad(LoadEvent, LoadEventListener$LoadType) line: 1129
SessionImpl.access$2600(SessionImpl, LoadEvent, LoadEventListener$LoadType) line: 164
SessionImpl$IdentifierLoadAccessImpl.load(Serializable) line: 2696
SessionImpl.get(Class<T>, Serializable) line: 975

Environment

None

Assignee

Gail Badner

Reporter

Dima Solomonov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure