hibernate/hibernate-orm · error · FunctionArgumentException
Path '" + ctx.path() + "' resolved to '" + pluralPath.getRef
Error message
Path '" + ctx.path() + "' resolved to '" + pluralPath.getReferencedPathSource() + "' which is not an indexed collection
What it means
Error "Path '" + ctx.path() + "' resolved to '" + pluralPath.getReferencedPathSource() + "' which is not an indexed collection" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java:5676
}
}
@Override
public SqmExpression<?> visitIndexAggregateFunction(HqlParser.IndexAggregateFunctionContext ctx) {
if ( creationOptions.useStrictJpaCompliance() ) {
throw new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.HQL_COLLECTION_FUNCTION );
}
// the actual function name might be 'minindex' or 'maxindex', so trim it
final String functionName = ctx.getChild(0).getText().substring(0, 3);
final var path = consumePluralAttributeReference( ctx.path() );
if ( path instanceof SqmPluralValuedSimplePath<?> pluralPath ) {
if ( isIndexedPluralAttribute( pluralPath ) ) {
return new SqmIndexAggregateFunction<>( pluralPath, functionName );
}
else {
throw new FunctionArgumentException( "Path '" + ctx.path()
+ "' resolved to '"
+ pluralPath.getReferencedPathSource()
+ "' which is not an indexed collection" );
}
}
else {
// indices() and keys() only apply to compound paths
if ( path instanceof SqmMapJoin ) {
throw new FunctionArgumentException( "Path '" + ctx.path().getText()
+ "' resolved to a joined map instead of a compound path" );
}
else if ( path instanceof SqmListJoin ) {
throw new FunctionArgumentException( "Path '" + ctx.path().getText()
+ "' resolved to a joined list instead of a compound path" );
}
else {
throw new FunctionArgumentException( "Path '" + ctx.path().getText()
+ "' did not resolve to a many-valued attribute" );View on GitHub (pinned to fad1729dce)
Solutions
- The path resolves to a collection that is not indexed (neither list nor map). Index access requires a List or Map collection; use elements() or a join instead.
When it happens
Trigger: A collection-typed path is required but not found: Path '" + ctx.path() + "' resolved to '" + pluralPath.getReferencedPathSource() + "' which is not an indexed collection
Common situations: Applying collection operations (elements/indices/key/value/index, slice, member of) to singular paths, or to joined lists/maps that are not compound/indexed paths.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/f1310334293269c2.
Report an issue: GitHub.