hibernate/hibernate-orm · error · IllegalArgumentException

Could not resolve a BasicType for the Java type: " + resultT

Error message

Could not resolve a BasicType for the Java type: " + resultType.getName()

What it means

Error "Could not resolve a BasicType for the Java type: " + resultType.getName()" thrown in hibernate/hibernate-orm.

Source

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

	}

	@Override
	@Nonnull
	public <T> FunctionReturnImplementor<T> registerResultParameter(@Nonnull Class<T> aClass) {
		checkNotClosed();
		//noinspection resource
		markAsFunctionCall( aClass );
		//noinspection unchecked
		return (FunctionReturnImplementor<T>) functionReturn;
	}

	@Override
	@Nonnull
	public ProcedureCallImplementor<R> markAsFunctionCall(@Nonnull Class<?> resultType) {
		checkNotClosed();
		final var basicType = getTypeConfiguration().getBasicTypeForJavaType( resultType );
		if ( basicType == null ) {
			throw new IllegalArgumentException( "Could not resolve a BasicType for the Java type: " + resultType.getName() );
		}
		markAsFunctionCall( basicType );
		return this;
	}

	@Override
	@Nonnull
	public ProcedureCall markAsFunctionCall(@Nonnull Type<?> typeReference) {
		checkNotClosed();
		if ( !(typeReference instanceof OutputableType<?> outputableType) ) {
			throw new IllegalArgumentException( "Given type is not an OutputableType: " + typeReference );
		}

		assert !resultSetMappings.isEmpty();
		final var firstResultSetMapping = resultSetMappings.get( 0 );
		if ( firstResultSetMapping.getNumberOfResultBuilders() == 0 ) {
			final var expressible = resolveExpressible( typeReference );
			// Function returns might not be represented as callable parameters,

View on GitHub (pinned to fad1729dce)

Solutions

  1. Register the result class as a managed/basic type, or use a type Hibernate can map natively.
  2. Pass an explicit BasicType or SqlResultSetMapping instead of relying on automatic resolution.

When it happens

Trigger: A name referenced in a mapping, query, or configuration cannot be resolved at runtime.

Common situations: Typos in entity/attribute/mapping names, missing mappings, or refactoring without updating references.


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