hibernate/hibernate-orm · error · QueryException

JSON path [" + JsonPathHelper.toJsonPath( jsonPathElements )

Error message

JSON path [" + JsonPathHelper.toJsonPath( jsonPathElements ) + "] uses parameter [" + parameterName + "] that is not passed

What it means

Error "JSON path [" + JsonPathHelper.toJsonPath( jsonPathElements ) + "] 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/CockroachDBJsonQueryFunction.java:107

		}
		else {
			sqlAppender.appendSql( ')' );
		}
		if ( !jsonPathElements.isEmpty() ) {
			sqlAppender.appendSql( "#>array" );
			char separator = '[';
			final Dialect dialect = walker.getSessionFactory().getJdbcServices().getDialect();
			for ( JsonPathHelper.JsonPathElement jsonPathElement : jsonPathElements ) {
				sqlAppender.appendSql( separator );
				if ( jsonPathElement instanceof JsonPathHelper.JsonAttribute attribute ) {
					dialect.appendLiteral( sqlAppender, attribute.attribute() );
				}
				else if ( jsonPathElement instanceof JsonPathHelper.JsonParameterIndexAccess ) {
					assert jsonPathPassingClause != null;
					final String parameterName = ((JsonPathHelper.JsonParameterIndexAccess) jsonPathElement).parameterName();
					final Expression expression = jsonPathPassingClause.getPassingExpressions().get( parameterName );
					if ( expression == null ) {
						throw new QueryException(
								"JSON path [" + JsonPathHelper.toJsonPath( jsonPathElements ) + "] uses parameter [" + parameterName + "] that is not passed" );
					}

					sqlAppender.appendSql( "cast(" );
					expression.accept( walker );
					sqlAppender.appendSql( " as text)" );
				}
				else {
					sqlAppender.appendSql( '\'' );
					sqlAppender.appendSql( ((JsonPathHelper.JsonIndexAccess) jsonPathElement).index() );
					sqlAppender.appendSql( '\'' );
				}
				separator = ',';
			}
			sqlAppender.appendSql( ']' );
		}
	}
}

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 (CockroachDB).

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 (CockroachDB).


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