HHH-13944 HQL/JPQL size() does not work (anymore) with nested expression
This commit is contained in:
parent
c99904a606
commit
20008b19bc
|
@ -68,6 +68,7 @@ tokens
|
|||
private boolean inFrom = false;
|
||||
private boolean inCount = false;
|
||||
private boolean inCountDistinct = false;
|
||||
private boolean inSize = false;
|
||||
|
||||
private int statementType;
|
||||
private String statementTypeName;
|
||||
|
@ -108,6 +109,10 @@ tokens
|
|||
return inCountDistinct;
|
||||
}
|
||||
|
||||
public final boolean isInSize() {
|
||||
return inSize;
|
||||
}
|
||||
|
||||
public final int getStatementType() {
|
||||
return statementType;
|
||||
}
|
||||
|
@ -691,8 +696,9 @@ collectionFunction
|
|||
;
|
||||
|
||||
functionCall
|
||||
: #( COLL_SIZE path:collectionPath ) {
|
||||
: #( COLL_SIZE {inSize=true;} path:collectionPath ) {
|
||||
#functionCall = createCollectionSizeFunction( #path, inSelect );
|
||||
inSize=false;
|
||||
}
|
||||
| #(METHOD_CALL {inFunctionCall=true;} pathAsIdent ( #(EXPR_LIST (exprOrSubquery [ null ])* ) )? ) {
|
||||
processFunction( #functionCall, inSelect );
|
||||
|
|
|
@ -417,7 +417,8 @@ public class DotNode extends FromReferenceNode implements DisplayableNode, Selec
|
|||
joinIsNeeded = generateJoin;
|
||||
}
|
||||
else {
|
||||
joinIsNeeded = generateJoin || ( getWalker().isInSelect() || getWalker().isInFrom() );
|
||||
joinIsNeeded = generateJoin
|
||||
|| ( getWalker().isInSelect() || getWalker().isInFrom() || ( implicitJoin && getWalker().isInSize() ) );
|
||||
}
|
||||
|
||||
if ( joinIsNeeded ) {
|
||||
|
|
Loading…
Reference in New Issue