diff --git a/core/src/main/java/org/hibernate/id/CompositeNestedGeneratedValueGenerator.java b/core/src/main/java/org/hibernate/id/CompositeNestedGeneratedValueGenerator.java index c02b1c8ec4..87614d19c3 100644 --- a/core/src/main/java/org/hibernate/id/CompositeNestedGeneratedValueGenerator.java +++ b/core/src/main/java/org/hibernate/id/CompositeNestedGeneratedValueGenerator.java @@ -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; diff --git a/core/src/main/java/org/hibernate/mapping/Component.java b/core/src/main/java/org/hibernate/mapping/Component.java index 13c0b6d3d4..c4ba789af7 100644 --- a/core/src/main/java/org/hibernate/mapping/Component.java +++ b/core/src/main/java/org/hibernate/mapping/Component.java @@ -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() ); } }