diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index b64765509f..ef13465478 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -47,6 +47,7 @@ import org.hibernate.LockMode; import org.hibernate.LockOptions; import org.hibernate.MappingException; import org.hibernate.QueryException; +import org.hibernate.Session; import org.hibernate.StaleObjectStateException; import org.hibernate.StaleStateException; import org.hibernate.bytecode.instrumentation.spi.FieldInterceptor; @@ -3456,7 +3457,7 @@ public abstract class AbstractEntityPersister final InMemoryValueGenerationStrategy[] strategies = getEntityMetamodel().getInMemoryValueGenerationStrategies(); for ( int i = 0; i < strategies.length; i++ ) { if ( strategies[i] != null && strategies[i].getGenerationTiming().includesUpdate() ) { - fields[i] = strategies[i].getValueGenerator().generateValue( session, object ); + fields[i] = strategies[i].getValueGenerator().generateValue( (Session) session, object ); setPropertyValue( object, i, fields[i] ); // todo : probably best to add to dirtyFields if not-null } @@ -3566,7 +3567,7 @@ public abstract class AbstractEntityPersister final InMemoryValueGenerationStrategy[] strategies = getEntityMetamodel().getInMemoryValueGenerationStrategies(); for ( int i = 0; i < strategies.length; i++ ) { if ( strategies[i] != null && strategies[i].getGenerationTiming().includesInsert() ) { - fields[i] = strategies[i].getValueGenerator().generateValue( session, object ); + fields[i] = strategies[i].getValueGenerator().generateValue( (Session) session, object ); setPropertyValue( object, i, fields[i] ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/ValueGenerator.java b/hibernate-core/src/main/java/org/hibernate/tuple/ValueGenerator.java index 35c2c17251..f72e053f78 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/ValueGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/ValueGenerator.java @@ -23,7 +23,7 @@ */ package org.hibernate.tuple; -import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.Session; /** * Defines a generator for in-VM generation of (non-identifier) attribute values. @@ -39,5 +39,5 @@ public interface ValueGenerator { * * @return The generated value */ - public T generateValue(SessionImplementor session, Object owner); + public T generateValue(Session session, Object owner); }