diff --git a/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedMap.java b/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedMap.java index 662264c47c..b3e67b28da 100644 --- a/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedMap.java +++ b/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedMap.java @@ -17,6 +17,7 @@ import java.util.TreeMap; import org.hibernate.EntityMode; import org.hibernate.HibernateException; import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.collection.BasicCollectionPersister; /** @@ -41,7 +42,7 @@ public class PersistentSortedMap extends PersistentMap implements SortedMap { * * @param session The session */ - public PersistentSortedMap(SessionImplementor session) { + public PersistentSortedMap(SharedSessionContractImplementor session) { super( session ); } @@ -51,7 +52,7 @@ public class PersistentSortedMap extends PersistentMap implements SortedMap { * @param session The session * @param map The underlying map data */ - public PersistentSortedMap(SessionImplementor session, SortedMap map) { + public PersistentSortedMap(SharedSessionContractImplementor session, SortedMap map) { super( session, map ); comparator = map.comparator(); } diff --git a/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedSet.java b/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedSet.java index cc109ba2a5..75d3606bbd 100644 --- a/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedSet.java +++ b/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentSortedSet.java @@ -14,6 +14,7 @@ import java.util.TreeMap; import org.hibernate.EntityMode; import org.hibernate.HibernateException; import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.collection.BasicCollectionPersister; /** @@ -38,7 +39,7 @@ public class PersistentSortedSet extends PersistentSet implements SortedSet { * * @param session The session */ - public PersistentSortedSet(SessionImplementor session) { + public PersistentSortedSet(SharedSessionContractImplementor session) { super( session ); } @@ -48,7 +49,7 @@ public class PersistentSortedSet extends PersistentSet implements SortedSet { * @param session The session * @param set The underlying set data */ - public PersistentSortedSet(SessionImplementor session, SortedSet set) { + public PersistentSortedSet(SharedSessionContractImplementor session, SortedSet set) { super( session, set ); comparator = set.comparator(); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java b/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java index 6e0484818d..51d7dc9581 100755 --- a/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java @@ -9,7 +9,7 @@ package org.hibernate.type; import java.lang.reflect.Method; import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.tuple.component.ComponentMetamodel; /** @@ -28,7 +28,8 @@ public class EmbeddedComponentType extends ComponentType { return componentTuplizer.isMethodOf( method ); } - public Object instantiate(Object parent, SessionImplementor session) throws HibernateException { + @Override + public Object instantiate(Object parent, SharedSessionContractImplementor session) throws HibernateException { final boolean useParent = parent != null && //TODO: Yuck! This is not quite good enough, it's a quick //hack around the problem of having a to-one association diff --git a/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java b/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java index 7e395d3d9e..c4bd0f50b2 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java @@ -12,7 +12,7 @@ import java.util.TreeMap; import org.hibernate.collection.internal.PersistentSortedMap; import org.hibernate.collection.spi.PersistentCollection; -import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.collection.CollectionPersister; @@ -25,7 +25,8 @@ public class SortedMapType extends MapType { this.comparator = comparator; } - public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { + @Override + public PersistentCollection instantiate(SharedSessionContractImplementor session, CollectionPersister persister, Serializable key) { PersistentSortedMap map = new PersistentSortedMap(session); map.setComparator(comparator); return map; @@ -39,8 +40,9 @@ public class SortedMapType extends MapType { public Object instantiate(int anticipatedSize) { return new TreeMap(comparator); } - - public PersistentCollection wrap(SessionImplementor session, Object collection) { + + @Override + public PersistentCollection wrap(SharedSessionContractImplementor session, Object collection) { return new PersistentSortedMap( session, (java.util.SortedMap) collection ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java b/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java index 91171fc273..3150206686 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java @@ -12,7 +12,7 @@ import java.util.TreeSet; import org.hibernate.collection.internal.PersistentSortedSet; import org.hibernate.collection.spi.PersistentCollection; -import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.collection.CollectionPersister; public class SortedSetType extends SetType { @@ -23,7 +23,8 @@ public class SortedSetType extends SetType { this.comparator = comparator; } - public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) { + @Override + public PersistentCollection instantiate(SharedSessionContractImplementor session, CollectionPersister persister, Serializable key) { PersistentSortedSet set = new PersistentSortedSet(session); set.setComparator(comparator); return set; @@ -37,8 +38,9 @@ public class SortedSetType extends SetType { public Object instantiate(int anticipatedSize) { return new TreeSet(comparator); } - - public PersistentCollection wrap(SessionImplementor session, Object collection) { + + @Override + public PersistentCollection wrap(SharedSessionContractImplementor session, Object collection) { return new PersistentSortedSet( session, (java.util.SortedSet) collection ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/SpecialOneToOneType.java b/hibernate-core/src/main/java/org/hibernate/type/SpecialOneToOneType.java index d54412d354..4a53600528 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SpecialOneToOneType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SpecialOneToOneType.java @@ -15,8 +15,8 @@ import org.hibernate.HibernateException; import org.hibernate.MappingException; import org.hibernate.engine.internal.ForeignKeys; import org.hibernate.engine.spi.Mapping; -import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.jdbc.Size; +import org.hibernate.engine.spi.SharedSessionContractImplementor; /** * A one-to-one association that maps to specific formula(s) @@ -86,16 +86,17 @@ public class SpecialOneToOneType extends OneToOneType { public boolean useLHSPrimaryKey() { return false; } - - public Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) + + @Override + public Object hydrate(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { return super.getIdentifierOrUniqueKeyType( session.getFactory() ) .nullSafeGet(rs, names, session, owner); } // TODO: copy/paste from ManyToOneType - - public Serializable disassemble(Object value, SessionImplementor session, Object owner) + @Override + public Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException { if (value==null) { @@ -115,7 +116,8 @@ public class SpecialOneToOneType extends OneToOneType { } } - public Object assemble(Serializable oid, SessionImplementor session, Object owner) + @Override + public Object assemble(Serializable oid, SharedSessionContractImplementor session, Object owner) throws HibernateException { //TODO: currently broken for unique-key references (does not detect // change to unique key property of the associated object)