hibernate/hibernate-orm · error · StrictJpaComplianceViolation

FQN_ENTITY_NAME

FQN_ENTITY_NAME

Error message

Encountered FQN entity name [" + name + "], but strict JPQL compliance was requested ( [" + entityDescriptor.getName() + "] should be used instead )

What it means

Error "Encountered FQN entity name [" + name + "], but strict JPQL compliance was requested ( [" + entityDescriptor.getName() + "] should be used instead )" thrown in hibernate/hibernate-orm.

Source

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

	}

	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
			ParameterStyle withNamed() {
				return NAMED;
			}

			@Override
			ParameterStyle withPositional() {
				return POSITIONAL;
			}
		},

View on GitHub (pinned to fad1729dce)

Solutions

  1. Strict JPQL compliance forbids fully-qualified entity names. Use the entity name (as given by @Entity(name=...) or the simple class name) instead of the FQN, or relax compliance.

When it happens

Trigger: An HQL-specific construct is used while strict JPQL compliance is enabled: Encountered FQN entity name [" + name + "], but strict JPQL compliance was requested ( [" + entityDescriptor.getName() + "] should be used instead )

Common situations: Applications running with hibernate.jpa.compliance.query=true (or JPA-compliance mode) that submit queries using Hibernate extensions such as collations, tuples/row value constructors, HQL collection functions (maxelement/elements/indices), value()/key() on non-Map types, or non-standard function calls without FUNCTION() syntax.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/e5aad891f09abcd3. Report an issue: GitHub.