Avoid new join sqm path creation when it already exists
This commit is contained in:
parent
4144c4af4c
commit
3e32e15c0a
|
@ -144,13 +144,19 @@ public class BasicDotIdentifierConsumer implements DotIdentifierConsumer {
|
||||||
// identifier is an "unqualified attribute reference"
|
// identifier is an "unqualified attribute reference"
|
||||||
validateAsRoot( pathRootByExposedNavigable );
|
validateAsRoot( pathRootByExposedNavigable );
|
||||||
|
|
||||||
final SqmPathSource subPathSource = pathRootByExposedNavigable.getReferencedPathSource().findSubPathSource( identifier );
|
SqmPath sqmPath = pathRootByExposedNavigable.getImplicitJoinPath( identifier );
|
||||||
final SqmPath sqmPath = subPathSource.createSqmPath( pathRootByExposedNavigable, creationState );
|
if ( sqmPath == null ) {
|
||||||
|
final SqmPathSource subPathSource = pathRootByExposedNavigable.getReferencedPathSource()
|
||||||
|
.findSubPathSource( identifier );
|
||||||
|
sqmPath = subPathSource.createSqmPath( pathRootByExposedNavigable, creationState );
|
||||||
|
if ( !isTerminal ) {
|
||||||
|
pathRootByExposedNavigable.registerImplicitJoinPath( sqmPath );
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( isTerminal ) {
|
if ( isTerminal ) {
|
||||||
return sqmPath;
|
return sqmPath;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pathRootByExposedNavigable.registerImplicitJoinPath( sqmPath );
|
|
||||||
return new DomainPathPart( sqmPath );
|
return new DomainPathPart( sqmPath );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue