hibernate/hibernate-orm · error · MappingException

Returned class name not specified for basic mapping: {}

Error message

Returned class name not specified for basic mapping: {}

What it means

Error "Returned class name not specified for basic mapping: {}" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java:1277

		if ( isLob() ) {
			basicValue.makeLob();
		}

		if ( isNationalized() ) {
			basicValue.makeNationalized();
		}

		if ( explicitCustomType != null ) {
			basicValue.setExplicitCustomType( explicitCustomType );
		}
	}

	private Map<String, Object> createDynamicParameterizedTypeParameters() {
		final Map<String, Object> parameters = new HashMap<>();

		if ( returnedClassName == null ) {
			throw new MappingException( "Returned class name not specified for basic mapping: " + memberDetails.getName() );
		}

		parameters.put( DynamicParameterizedType.RETURNED_CLASS, returnedClassName );
		parameters.put( DynamicParameterizedType.XPROPERTY, memberDetails );
		parameters.put( DynamicParameterizedType.PROPERTY, memberDetails.getName() );

		parameters.put( DynamicParameterizedType.IS_DYNAMIC, Boolean.toString( true ) );
		parameters.put( DynamicParameterizedType.IS_PRIMARY_KEY, Boolean.toString( kind == Kind.MAP_KEY ) );

		if ( persistentClassName != null ) {
			parameters.put( DynamicParameterizedType.ENTITY, persistentClassName );
		}

		if ( returnedClassName != null ) {
			parameters.put( DynamicParameterizedType.RETURNED_CLASS, returnedClassName );
		}

		if ( accessType != null ) {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Specify the returned class name for the basic mapping so the binder can resolve the Java type.
  2. Provide an explicit type via the appropriate annotation or type descriptor.

When it happens

Trigger: A basic mapping does not declare the Java class it maps to.

Common situations: Custom/basic type mappings where the returned class name was not supplied, leaving Hibernate unable to resolve the attribute type.


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