hibernate/hibernate-orm · error · UnknownProfileException

No fetch profile named '{}'

Error message

No fetch profile named '{}'

What it means

Error "No fetch profile named '{}'" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/internal/SelectionQueryImpl.java:638

	}

	@Override
	@Nonnull
	public SelectionQueryImplementor<R> setResultListTransformer(@Nonnull ResultListTransformer<R> transformer) {
		queryOptions.setResultListTransformer( transformer );
		return this;
	}

	@Override
	@SuppressWarnings("removal")
	@Nonnull
	public SelectionQueryImplementor<R> enableFetchProfile(@Nonnull String profileName) {
		if ( getSessionFactory().containsFetchProfileDefinition( profileName ) ) {
			getQueryOptions().enableFetchProfile( profileName );
			return this;
		}
		else {
			throw new UnknownProfileException( profileName );
		}
	}

	@Override
	@SuppressWarnings("removal")
	@Nonnull
	public SelectionQueryImplementor<R> disableFetchProfile(@Nonnull String profileName) {
		getQueryOptions().disableFetchProfile( profileName );
		return this;
	}

	@Override
	@Nonnull
	public SelectionQueryImplementor<R> setComment(@Nullable String comment) {
		super.setComment( comment );
		return this;
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. No fetch profile with that name exists. Check the profile name and that it is defined via @FetchProfile on a scanned class.

When it happens

Trigger: An entity graph or fetch profile is applied where unsupported: No fetch profile named '<value>'

Common situations: Setting fetch graphs/load graphs or fetch profiles on mutation queries, or referencing an undefined fetch profile name.


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