hibernate/hibernate-orm · error · IllegalArgumentException

Given type is not an OutputableType: " + typeReference

Error message

Given type is not an OutputableType: " + typeReference

What it means

Error "Given type is not an OutputableType: " + typeReference" thrown in hibernate/hibernate-orm.

Source

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

	@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,
			// but we still want to convert the result to the requested java type if possible
			firstResultSetMapping.addResultBuilder( new ScalarDomainResultBuilder<>( expressible.getExpressibleJavaType() ) );
		}
		functionReturn = new FunctionReturnImpl<>( this, (OutputableType<?>) outputableType );
		return this;
	}

	private void markAsFunctionCall(BasicType<?> basicType) {
		assert !resultSetMappings.isEmpty();
		final var firstResultSetMapping = resultSetMappings.get( 0 );
		if ( firstResultSetMapping.getNumberOfResultBuilders() == 0 ) {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Register the parameter with a type that implements OutputableType (e.g. a BasicType).
  2. Use a supported JDBC-mappable type for the OUT parameter.

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/836827b6ea7d3fe6. Report an issue: GitHub.