hibernate/hibernate-orm · error · TransformationException

Error transforming <many-to-one/>

Error message

Error transforming <many-to-one/> : {}

What it means

Wrapper around transformation of an hbm <many-to-one/> attribute: the transferManyToOne step threw and the failure is rethrown naming the association property and origin.

Solutions

  1. Check the <many-to-one/> element attributes (class, column, not-null, fetch) for correctness.
  2. Verify the referenced target entity class is mapped and the column names are valid.
  3. Review the causal exception to pinpoint the failing attribute.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: The hbm.xml to mapping.xml transformer hits an unexpected structure.

Common situations: Converting legacy hbm.xml documents containing constructs the transformer does not handle.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java:2191

						"<dynamic-component/> mappings not supported for transformation [name=%s]",
						name
				);
			}
			else if ( hbmAttributeMapping instanceof JaxbHbmOneToOneType hbmOneToOne ) {
				try {
					final var propertyInfo = managedTypeInfo.propertyInfoMap().get( hbmOneToOne.getName() );
					transferOneToOne( hbmOneToOne, propertyInfo, attributes );
				}
				catch (Exception e) {
					throw new TransformationException( "Error transforming <one-to-one/> : " + hbmOneToOne.getName(), e, origin() );
				}
			}
			else if ( hbmAttributeMapping instanceof JaxbHbmManyToOneType hbmManyToOne ) {
				try {
					transferManyToOne( managedTypeInfo, attributes, hbmManyToOne );
				}
				catch (Exception e) {
					throw new TransformationException( "Error transforming <many-to-one/> : " + hbmManyToOne.getName(), e, origin() );
				}
			}
			else if ( hbmAttributeMapping instanceof JaxbHbmAnyAssociationType any ) {
				try {
					final var propertyInfo = managedTypeInfo.propertyInfoMap().get( any.getName() );
					attributes.getAnyMappingAttributes().add( transformAnyAttribute( any, propertyInfo ) );
				}
				catch (Exception e) {
					throw new TransformationException( "Error transforming <any/> : " + any.getName(), e, origin() );
				}
			}
			else if ( hbmAttributeMapping instanceof PluralAttributeInfo hbmCollection ) {
				final var propertyInfo = managedTypeInfo.propertyInfoMap().get( hbmCollection.getName() );
				if ( hbmCollection.getElement() != null || hbmCollection.getCompositeElement() != null ) {
					try {
						attributes.getElementCollectionAttributes().add( transformElementCollection( roleBase, hbmCollection, propertyInfo ) );
					}
					catch (Exception e) {

View on GitHub (pinned to fad1729dce)