hibernate/hibernate-orm · error · StrictJpaComplianceViolation

Strict JPA query language compliance was violated: improper

Error message

Strict JPA query language compliance was violated: improper non-standard function call

What it means

Error "Strict JPA query language compliance was violated: improper non-standard function call" thrown in hibernate/hibernate-orm.

Source

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

				length == null
						? asList( string, replacement, start )
						: asList( string, replacement, start, length ),
				null,
				queryEngine()
		);
	}

	@Override
	public SqmExpression<?> visitEveryFunction(HqlParser.EveryFunctionContext ctx) {
		final var subqueryContext = ctx.subquery();
		final var predicate = ctx.predicate();
		if ( subqueryContext != null ) {
			final var subquery = (SqmSubQuery<?>) subqueryContext.accept( this );
			return new SqmEvery<>( subquery, nodeBuilder() );
		}
		else if ( predicate != null ) {
			if ( getCreationOptions().useStrictJpaCompliance() ) {
				throw new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.FUNCTION_CALL );
			}
			final var argument = (SqmExpression<?>) predicate.accept( this );
			return applyOverClause(
					ctx.overClause(),
					getFunctionDescriptor( "every" ).generateAggregateSqmExpression(
							singletonList( argument ),
							getFilterExpression( ctx ),
							nodeBuilder().getBooleanType(),
							queryEngine()
					)
			);
		}
		else {
			if ( getCreationOptions().useStrictJpaCompliance() ) {
				throw new StrictJpaComplianceViolation( StrictJpaComplianceViolation.Type.HQL_COLLECTION_FUNCTION );
			}
			return new SqmEvery<>(
					createCollectionReferenceSubQuery(

View on GitHub (pinned to fad1729dce)

Solutions

  1. A non-standard function call was used while strict JPA compliance was requested. Rewrite the call using JPA-standard FUNCTION('name', ...) syntax or disable strict JPA compliance.

When it happens

Trigger: An HQL-specific construct is used while strict JPQL compliance is enabled: Strict JPA query language compliance was violated: improper non-standard function call

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