hibernate/hibernate-orm · error · PathException

Expecting plural attribute valued path [" + sqmPath.getNavig

Error message

Expecting plural attribute valued path [" + sqmPath.getNavigablePath() + "], but found: " + pathSource.getPathType()

What it means

Error "Expecting plural attribute valued path [" + sqmPath.getNavigablePath() + "], but found: " + pathSource.getPathType()" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java:6197

		final var sqmPath = consumeDomainPath( parserPath );
		final var pathType = sqmPath.getReferencedPathSource().getPathType();
		if ( pathType instanceof ManagedDomainType<?> || pathType instanceof AnyMappingDomainType<?> ) {
			return sqmPath;
		}
		else {
			throw new PathException( "Expecting ManagedType or @Any valued path ["
						+ sqmPath.getNavigablePath() + "], but found: " + pathType );
		}
	}

	private SqmPath<?> consumePluralAttributeReference(HqlParser.PathContext parserPath) {
		final var sqmPath = consumeDomainPath( parserPath );
		final var pathSource = sqmPath.getReferencedPathSource();
		if ( pathSource instanceof PluralPersistentAttribute ) {
			return sqmPath;
		}
		else {
			throw new PathException( "Expecting plural attribute valued path ["
						+ sqmPath.getNavigablePath() + "], but found: "
						+ pathSource.getPathType() );
		}
	}

	private void checkFQNEntityNameJpaComplianceViolationIfNeeded(String name, EntityDomainType<?> entityDescriptor) {
		if ( getCreationOptions().useStrictJpaCompliance() && ! name.equals( entityDescriptor.getName() ) ) {
			// FQN is the only possible reason
			throw new StrictJpaComplianceViolation("Encountered FQN entity name [" + name + "], " +
					"but strict JPQL compliance was requested ( [" + entityDescriptor.getName() + "] should be used instead )",
					StrictJpaComplianceViolation.Type.FQN_ENTITY_NAME
			);
		}
	}

	private enum ParameterStyle {
		UNKNOWN {
			@Override

View on GitHub (pinned to fad1729dce)

Solutions

  1. The path must resolve to a plural (collection) attribute. Verify the referenced attribute is collection-valued.

When it happens

Trigger: A collection-typed path is required but not found: Expecting plural attribute valued path [" + sqmPath.getNavigablePath() + "], but found: " + pathSource.getPathType()

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/a4c2bae0af90852c. Report an issue: GitHub.