SemanticQueryBuilder#visitPathExpression() cannot cast DomainPathPart to SqmExpression
This commit is contained in:
parent
15b52460f3
commit
60c4fbe099
|
@ -29,6 +29,10 @@ public class DomainPathPart implements SemanticPathPart {
|
|||
assert currentPath != null;
|
||||
}
|
||||
|
||||
SqmExpression<?> getSqmExpression() {
|
||||
return currentPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SemanticPathPart resolvePathPart(
|
||||
String name,
|
||||
|
|
|
@ -1158,7 +1158,12 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
|
|||
|
||||
@Override
|
||||
public SqmExpression<?> visitPathExpression(HqlParser.PathExpressionContext ctx) {
|
||||
return (SqmExpression<?>) ctx.path().accept( this );
|
||||
final HqlParser.PathContext path = ctx.path();
|
||||
final Object accept = path.accept( this );
|
||||
if ( accept instanceof DomainPathPart ) {
|
||||
return ( (DomainPathPart) accept ).getSqmExpression();
|
||||
}
|
||||
return (SqmExpression<?>) accept;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -61,6 +61,17 @@ public class SubQueryImplicitJoinReferenceTest {
|
|||
} );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void performHqlIsNullTest(SessionFactoryScope scope) {
|
||||
// Now simulate running an audit query
|
||||
scope.inSession( session -> {
|
||||
session.createQuery( "select e__ FROM TheEntity e__ "
|
||||
+ "WHERE e__.originalId.rev.id = (select max(e2__.originalId.rev.id) FROM "
|
||||
+ "TheEntity e2__ WHERE " +
|
||||
"e2__.originalId.rev is null)" ).list();
|
||||
} );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void performHqlTest2(SessionFactoryScope scope) {
|
||||
// Now simulate running an audit query
|
||||
|
|
Loading…
Reference in New Issue