HHH-2907 Changing ValueGenerator contract in order to allow implementations performing work using the JDBC connection
This commit is contained in:
parent
9938937fe7
commit
a860e6559d
|
@ -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] );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<T> {
|
|||
*
|
||||
* @return The generated value
|
||||
*/
|
||||
public T generateValue(SessionImplementor session, Object owner);
|
||||
public T generateValue(Session session, Object owner);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue