diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java index 617d2c989b..91399ed7ed 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java @@ -92,6 +92,7 @@ import org.hibernate.cfg.PropertyHolder; import org.hibernate.cfg.PropertyHolderBuilder; import org.hibernate.cfg.PropertyInferredData; import org.hibernate.cfg.PropertyPreloadedData; +import org.hibernate.cfg.RecoverableException; import org.hibernate.cfg.SecondPass; import org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle; import org.hibernate.internal.CoreMessageLogger; @@ -1446,9 +1447,13 @@ public abstract class CollectionBinder { boolean cascadeDeleteEnabled, XProperty property, Mappings mappings) { - BinderHelper.createSyntheticPropertyReference( - joinColumns, collValue.getOwner(), collectionEntity, collValue, false, mappings - ); + try { + BinderHelper.createSyntheticPropertyReference( + joinColumns, collValue.getOwner(), collectionEntity, collValue, false, mappings + ); + } catch(RecoverableException ex) { + throw new RecoverableException("Unable to map collection property " + property.getName() + "of class " + collectionEntity.getClassName(), ex); + } SimpleValue key = buildCollectionKey( collValue, joinColumns, cascadeDeleteEnabled, property, mappings ); if ( property.isAnnotationPresent( ElementCollection.class ) && joinColumns.length > 0 ) { joinColumns[0].setJPA2ElementCollection( true );