HHH-4847 inject both object id and the entity itself when asking nested identifier generators
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18632 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
8386be117a
commit
fc20582ede
|
@ -67,7 +67,7 @@ public class CompositeNestedGeneratedValueGenerator implements IdentifierGenerat
|
|||
}
|
||||
|
||||
public static interface GenerationPlan {
|
||||
public void execute(SessionImplementor session, Object incomingObject);
|
||||
public void execute(SessionImplementor session, Object incomingObject, Object objectId);
|
||||
}
|
||||
|
||||
private final GenerationContextLocator generationContextLocator;
|
||||
|
@ -87,7 +87,7 @@ public class CompositeNestedGeneratedValueGenerator implements IdentifierGenerat
|
|||
Iterator itr = generationPlans.iterator();
|
||||
while ( itr.hasNext() ) {
|
||||
final GenerationPlan plan = (GenerationPlan) itr.next();
|
||||
plan.execute( session, context );
|
||||
plan.execute( session, object, context );
|
||||
}
|
||||
|
||||
return context;
|
||||
|
|
|
@ -434,9 +434,9 @@ public class Component extends SimpleValue implements MetaAttributable {
|
|||
this.injector = injector;
|
||||
}
|
||||
|
||||
public void execute(SessionImplementor session, Object incomingObject) {
|
||||
public void execute(SessionImplementor session, Object incomingObject, Object idObject) {
|
||||
final Object generatedValue = subGenerator.generate( session, incomingObject );
|
||||
injector.set( incomingObject, generatedValue, session.getFactory() );
|
||||
injector.set( idObject, generatedValue, session.getFactory() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue