diff --git a/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java b/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java index dc0539f4c7..88dba86913 100644 --- a/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java +++ b/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java @@ -37,6 +37,6 @@ public class BagBinder extends CollectionBinder { } protected Collection createCollection(PersistentClass persistentClass) { - return new org.hibernate.mapping.Bag( persistentClass ); + return new org.hibernate.mapping.Bag( getMappings(), persistentClass ); } } diff --git a/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java b/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java index d1988f95d3..63a7650a12 100644 --- a/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java +++ b/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java @@ -163,6 +163,10 @@ public abstract class CollectionBinder { private AccessType accessType; private boolean hibernateExtensionMapping; + protected ExtendedMappings getMappings() { + return mappings; + } + public boolean isMap() { return false; } @@ -700,7 +704,7 @@ public abstract class CollectionBinder { ) { log.debug("Binding a OneToMany: {}.{} through a foreign key", propertyHolder.getEntityName(), propertyName); - org.hibernate.mapping.OneToMany oneToMany = new org.hibernate.mapping.OneToMany( collection.getOwner() ); + org.hibernate.mapping.OneToMany oneToMany = new org.hibernate.mapping.OneToMany( extendedMappings, collection.getOwner() ); collection.setElement( oneToMany ); oneToMany.setReferencedEntityName( collectionType.getName() ); oneToMany.setIgnoreNotFound( ignoreNotFound ); diff --git a/core/src/main/java/org/hibernate/Hibernate.java b/core/src/main/java/org/hibernate/Hibernate.java index 3993be5863..b582d56fa9 100644 --- a/core/src/main/java/org/hibernate/Hibernate.java +++ b/core/src/main/java/org/hibernate/Hibernate.java @@ -26,7 +26,6 @@ package org.hibernate; import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.io.Serializable; import java.io.ByteArrayOutputStream; import java.sql.Blob; import java.sql.Clob; @@ -44,7 +43,6 @@ import org.hibernate.intercept.FieldInterceptionHelper; import org.hibernate.intercept.FieldInterceptor; import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.LazyInitializer; -import org.hibernate.type.AnyType; import org.hibernate.type.BigDecimalType; import org.hibernate.type.BigIntegerType; import org.hibernate.type.BinaryType; @@ -56,16 +54,13 @@ import org.hibernate.type.CalendarType; import org.hibernate.type.CharacterType; import org.hibernate.type.ClassType; import org.hibernate.type.ClobType; -import org.hibernate.type.CompositeCustomType; import org.hibernate.type.CurrencyType; -import org.hibernate.type.CustomType; import org.hibernate.type.DateType; import org.hibernate.type.DoubleType; import org.hibernate.type.FloatType; import org.hibernate.type.IntegerType; import org.hibernate.type.LocaleType; import org.hibernate.type.LongType; -import org.hibernate.type.ManyToOneType; import org.hibernate.type.ObjectType; import org.hibernate.type.SerializableType; import org.hibernate.type.ShortType; @@ -76,7 +71,6 @@ import org.hibernate.type.TimeZoneType; import org.hibernate.type.TimestampType; import org.hibernate.type.TrueFalseType; import org.hibernate.type.Type; -import org.hibernate.type.TypeFactory; import org.hibernate.type.YesNoType; import org.hibernate.type.CharArrayType; import org.hibernate.type.WrapperBinaryType; @@ -84,7 +78,6 @@ import org.hibernate.type.CharacterArrayType; import org.hibernate.type.MaterializedBlobType; import org.hibernate.type.ImageType; import org.hibernate.type.MaterializedClobType; -import org.hibernate.usertype.CompositeUserType; /** *