improve error messages
This commit is contained in:
parent
0dfa91f6ec
commit
bd5b05cbe3
|
@ -3996,13 +3996,13 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
|
||||||
final SqmFrom<?, ?> sqmFrom = processingStateStack.getCurrent().getPathRegistry().findFromByAlias( alias );
|
final SqmFrom<?, ?> sqmFrom = processingStateStack.getCurrent().getPathRegistry().findFromByAlias( alias );
|
||||||
|
|
||||||
if ( sqmFrom == null ) {
|
if ( sqmFrom == null ) {
|
||||||
throw new ParsingException( "Could not resolve identification variable [" + alias + "] to SqmFrom" );
|
throw new ParsingException( "Alias '" + alias + "' did not resolve to a declared identification variable" );
|
||||||
}
|
}
|
||||||
|
|
||||||
final SqmPathSource<?> pluralAttribute = sqmFrom.getReferencedPathSource();
|
final SqmPathSource<?> pluralAttribute = sqmFrom.getReferencedPathSource();
|
||||||
|
|
||||||
if ( !( pluralAttribute instanceof PluralPersistentAttribute<?, ?, ?> ) ) {
|
if ( !( pluralAttribute instanceof PluralPersistentAttribute<?, ?, ?> ) ) {
|
||||||
throw new ParsingException( "Could not resolve identification variable [" + alias + "] as plural-attribute" );
|
throw new ParsingException( "Alias '" + alias + "' did not resolve to a many-valued attribute" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return sqmFrom.resolvePathPart( CollectionPart.Nature.INDEX.getName(), true, this );
|
return sqmFrom.resolvePathPart( CollectionPart.Nature.INDEX.getName(), true, this );
|
||||||
|
|
Loading…
Reference in New Issue