hibernate/hibernate-orm · error · IllegalSelectQueryException

Not a HQL query

Error message

Not a HQL query

What it means

Error "Not a HQL query" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java:1600

	@Override @Deprecated @SuppressWarnings("deprecation")
	@Nonnull
	public ProcedureCallImplementor<R> setParameter(int position, @Nullable Calendar value, @Nonnull TemporalType temporalPrecision) {
		super.setParameter( position, value, temporalPrecision );
		return this;
	}

	@Override @Deprecated @SuppressWarnings("deprecation")
	@Nonnull
	public ProcedureCallImplementor<R> setParameter(int position, @Nullable Date value, @Nonnull TemporalType temporalPrecision) {
		checkNotClosed();
		super.setParameter( position, value, temporalPrecision );
		return this;
	}

	@Override
	@Nonnull
	public <X> SelectionQueryImplementor<X> asSelectionQuery(EntityGraph<X> entityGraph, GraphSemantic graphSemantic) {
		throw new IllegalSelectQueryException( "Not a HQL query", getQueryString() );
	}

	@Nonnull
	@Override
	public QueryParameterImplementor<?> getParameter(@Nonnull String name) {
		checkNotClosed();
		return super.getParameter( name );
	}

	@Nonnull
	@Override
	public <T> QueryParameterImplementor<T> getParameter(@Nonnull String name, @Nonnull Class<T> type) {
		checkNotClosed();
		return super.getParameter( name, type );
	}

	@Nonnull
	@Override

View on GitHub (pinned to fad1729dce)

Solutions

  1. Do not treat a ProcedureCall as an HQL query; use the ProcedureCall API.
  2. Use session.createQuery(hql) if an HQL query is intended.

When it happens

Trigger: A runtime precondition of the Hibernate API is violated.

Common situations: Occurs when application code or configuration does not satisfy the documented contract of the API being called.


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