HHH-9244 Using collection owner name in exception message

This commit is contained in:
Gunnar Morling 2015-07-14 12:52:05 +02:00
parent 5e894c993b
commit e4781feb74
1 changed files with 9 additions and 9 deletions

View File

@ -12,6 +12,7 @@ import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CollectionTable;
@ -97,7 +98,6 @@ import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Table;
import org.jboss.logging.Logger;
import static org.hibernate.cfg.BinderHelper.toAliasEntityMap;
@ -156,7 +156,7 @@ public abstract class CollectionBinder {
private SortComparator comparatorSort;
private String explicitType;
private Properties explicitTypeParameters = new Properties();
private final Properties explicitTypeParameters = new Properties();
protected MetadataBuildingContext getBuildingContext() {
return buildingContext;
@ -1520,7 +1520,7 @@ public abstract class CollectionBinder {
);
}
catch (AnnotationException ex) {
throw new AnnotationException( "Unable to map collection " + collectionEntity.getClassName() + "." + property.getName(), ex );
throw new AnnotationException( "Unable to map collection " + collValue.getOwner().getClassName() + "." + property.getName(), ex );
}
SimpleValue key = buildCollectionKey( collValue, joinColumns, cascadeDeleteEnabled, property, buildingContext );
if ( property.isAnnotationPresent( ElementCollection.class ) && joinColumns.length > 0 ) {