From bd5b05cbe31face15381eb7d94b26dcf65317df5 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Tue, 8 Feb 2022 14:25:53 +0100 Subject: [PATCH] improve error messages --- .../hibernate/query/hql/internal/SemanticQueryBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java index 6d8bdb0dd3..e18d2dcc97 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java @@ -3996,13 +3996,13 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implem final SqmFrom sqmFrom = processingStateStack.getCurrent().getPathRegistry().findFromByAlias( alias ); 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(); 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 );