hibernate/hibernate-orm · error · IllegalArgumentException

No @NamedStoredProcedureQuery was found with that name

Error message

No @NamedStoredProcedureQuery was found with that name : {name}

What it means

Thrown by createNamedStoredProcedureQuery when the named-object repository has no stored-procedure query memento registered under the given name — the @NamedStoredProcedureQuery name is unknown or misspelled.

Solutions

  1. Define a @NamedStoredProcedureQuery with the given name on an entity in the persistence unit, or correct the name used in createNamedStoredProcedureQuery.
  2. Check for typos and ensure the entity declaring the named stored procedure is registered.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java:2722 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java:2722

			default:
				SESSION_LOGGER.tracef( "Unsupported property : %s", propertyName  );
				break;
		}
	}


	// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	@Override
	@Nonnull
	public ProcedureCall createNamedStoredProcedureQuery(@Nonnull String name) {
		checkOpen();
		try {
			final var memento =
					getFactory().getQueryEngine().getNamedObjectRepository()
							.getCallableQueryMemento( name );
			if ( memento == null ) {
				throw new IllegalArgumentException( "No @NamedStoredProcedureQuery was found with that name : " + name );
			}
			return memento.makeProcedureCall( this );
		}
		catch ( RuntimeException e ) {
			throw getExceptionConverter().convert( e );
		}
	}

	@Override
	@Nonnull
	public ProcedureCall createStoredProcedureQuery(@Nonnull String procedureName) {
		try {
			return createStoredProcedureCall( procedureName );
		}
		catch ( RuntimeException e ) {
			throw getExceptionConverter().convert( e );
		}
	}

View on GitHub (pinned to fad1729dce)