hibernate/hibernate-orm · error · QueryException

JSON path [${jsonPath}] uses parameter [${parameterName}] th

Error message

JSON path [${jsonPath}] uses parameter [${parameterName}] that is not passed

What it means

Error "JSON path [${jsonPath}] uses parameter [${parameterName}] that is not passed" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/dialect/function/json/PostgreSQLJsonSetFunction.java:59

			sqlAppender.appendSql( "cast(" );
		}
		json.accept( translator );
		if ( needsCast ) {
			sqlAppender.appendSql( " as jsonb)" );
		}
		sqlAppender.appendSql( ',' );
		List<JsonPathHelper.JsonPathElement> jsonPathElements =
				JsonPathHelper.parseJsonPathElements( translator.getLiteralValue( jsonPath ) );
		sqlAppender.appendSql( "array" );
		char separator = '[';
		for ( JsonPathHelper.JsonPathElement pathElement : jsonPathElements ) {
			sqlAppender.appendSql( separator );
			if ( pathElement instanceof JsonPathHelper.JsonAttribute attribute ) {
				sqlAppender.appendSingleQuoteEscapedString( attribute.attribute() );
			}
			else if ( pathElement instanceof JsonPathHelper.JsonParameterIndexAccess parameterIndexAccess ) {
				final String parameterName = parameterIndexAccess.parameterName();
				throw new QueryException( "JSON path [" + jsonPath + "] uses parameter [" + parameterName + "] that is not passed" );
			}
			else {
				sqlAppender.appendSql( '\'' );
				sqlAppender.appendSql( ( (JsonPathHelper.JsonIndexAccess) pathElement ).index() );
				sqlAppender.appendSql( '\'' );
			}
			separator = ',';
		}
		sqlAppender.appendSql( "]::text[]," );
		if ( value instanceof Literal literal && literal.getLiteralValue() == null ) {
			sqlAppender.appendSql( "null::jsonb" );
		}
		else {
			sqlAppender.appendSql( "to_jsonb(" );
			value.accept( translator );
			if ( value instanceof Literal literal && literal.getJdbcMapping().getJdbcType().isString() ) {
				// PostgreSQL until version 16 is not smart enough to infer the type of a string literal
				sqlAppender.appendSql( "::text" );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Add the missing parameter to the PASSING clause.
  2. Fix the parameter name in the JSON path.

When it happens

Trigger: Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: JSON path uses a parameter that is not passed (PostgreSQL json_set).

Common situations: Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: JSON path uses a parameter that is not passed (PostgreSQL json_set).


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