hibernate/hibernate-orm · error · UnsupportedOperationException

dynamic-map entity representation

Error message

dynamic-map entity representation

What it means

Error "dynamic-map entity representation" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/proxy/map/MapLazyInitializer.java:29

import org.hibernate.proxy.AbstractLazyInitializer;

/**
 * Lazy initializer for "dynamic-map" entity representations.
 *
 * @author Gavin King
 */
public class MapLazyInitializer extends AbstractLazyInitializer implements Serializable {

	MapLazyInitializer(String entityName, Object id, SharedSessionContractImplementor session) {
		super( entityName, id, session );
	}

	public Map getMap() {
		return (Map) getImplementation();
	}

	public Class<?> getPersistentClass() {
		throw new UnsupportedOperationException("dynamic-map entity representation");
	}

	@Override
	public Class<?> getImplementationClass() {
		throw new UnsupportedOperationException("dynamic-map entity representation");
	}

	// Expose the following methods to MapProxy by overriding them (so that classes in this package see them)

	@Override
	protected void prepareForPossibleLoadingOutsideTransaction() {
		super.prepareForPossibleLoadingOutsideTransaction();
	}

	@Override
	protected boolean isAllowLoadOutsideTransaction() {
		return super.isAllowLoadOutsideTransaction();
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Provide the entity name explicitly for dynamic-map proxies instead of relying on a class name.
  2. Use POJO entity mode if class-based resolution is needed.

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