HHH-12594 Do not share AliasResolutionContextImpl between EntityLoadQueryDetails instances
Sharing it results in some tables being aliased twice for the same query space, but with different aliases, resulting in exceptions. Ideally we should try to generate the aliases once, and then share the AliasResolutionContextImpl between EntityLoadQueryDetails instances, but I'm really not comfortable enough with this code to make that kind of changes.
This commit is contained in:
parent
ebda68958d
commit
4a53df0dd3
|
@ -87,17 +87,14 @@ public class EntityLoadQueryDetails extends AbstractLoadQueryDetails {
|
||||||
protected EntityLoadQueryDetails(
|
protected EntityLoadQueryDetails(
|
||||||
EntityLoadQueryDetails initialEntityLoadQueryDetails,
|
EntityLoadQueryDetails initialEntityLoadQueryDetails,
|
||||||
QueryBuildingParameters buildingParameters) {
|
QueryBuildingParameters buildingParameters) {
|
||||||
super(
|
this(
|
||||||
initialEntityLoadQueryDetails.getLoadPlan(),
|
initialEntityLoadQueryDetails.getLoadPlan(),
|
||||||
(AliasResolutionContextImpl) initialEntityLoadQueryDetails.getAliasResolutionContext(),
|
|
||||||
buildingParameters,
|
|
||||||
initialEntityLoadQueryDetails.getKeyColumnNames(),
|
initialEntityLoadQueryDetails.getKeyColumnNames(),
|
||||||
initialEntityLoadQueryDetails.getRootReturn(),
|
new AliasResolutionContextImpl( initialEntityLoadQueryDetails.getSessionFactory() ),
|
||||||
|
(EntityReturn) initialEntityLoadQueryDetails.getRootReturn(),
|
||||||
|
buildingParameters,
|
||||||
initialEntityLoadQueryDetails.getSessionFactory()
|
initialEntityLoadQueryDetails.getSessionFactory()
|
||||||
);
|
);
|
||||||
this.entityReferenceAliases = initialEntityLoadQueryDetails.entityReferenceAliases;
|
|
||||||
this.readerCollector = initialEntityLoadQueryDetails.readerCollector;
|
|
||||||
generate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntityReturn getRootEntityReturn() {
|
private EntityReturn getRootEntityReturn() {
|
||||||
|
|
Loading…
Reference in New Issue