mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 00:55:16 +00:00
Avoid new join sqm path creation when it already exists
This commit is contained in:
parent
4144c4af4c
commit
3e32e15c0a
@ -144,13 +144,19 @@ public SemanticPathPart resolvePathPart(
|
||||
// identifier is an "unqualified attribute reference"
|
||||
validateAsRoot( pathRootByExposedNavigable );
|
||||
|
||||
final SqmPathSource subPathSource = pathRootByExposedNavigable.getReferencedPathSource().findSubPathSource( identifier );
|
||||
final SqmPath sqmPath = subPathSource.createSqmPath( pathRootByExposedNavigable, creationState );
|
||||
SqmPath sqmPath = pathRootByExposedNavigable.getImplicitJoinPath( identifier );
|
||||
if ( sqmPath == null ) {
|
||||
final SqmPathSource subPathSource = pathRootByExposedNavigable.getReferencedPathSource()
|
||||
.findSubPathSource( identifier );
|
||||
sqmPath = subPathSource.createSqmPath( pathRootByExposedNavigable, creationState );
|
||||
if ( !isTerminal ) {
|
||||
pathRootByExposedNavigable.registerImplicitJoinPath( sqmPath );
|
||||
}
|
||||
}
|
||||
if ( isTerminal ) {
|
||||
return sqmPath;
|
||||
}
|
||||
else {
|
||||
pathRootByExposedNavigable.registerImplicitJoinPath( sqmPath );
|
||||
return new DomainPathPart( sqmPath );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user