Skip to content

Commit bd86647

Browse files
committed
[#1979] Fix find with EmbeddedId
When using the find with multiple embedded ids, only the first result was returned.
1 parent dc66f69 commit bd86647

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/graph/embeddable/internal/ReactiveEmbeddableInitializerImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public CompletionStage<Void> forEachReactiveSubInitializer(
8484
}
8585
}
8686

87+
@Override
88+
public void resolveInstance(EmbeddableInitializerData data) {
89+
// We need to clean up the instance, otherwise the .find with multiple id is not going to work correctly
90+
// See EmbeddedIdTest#testFindMultipleIds
91+
data.setInstance( null );
92+
super.resolveInstance( data );
93+
}
94+
8795
@Override
8896
public Object getResolvedInstance(EmbeddableInitializerData data) {
8997
return super.getResolvedInstance( data );

0 commit comments

Comments
 (0)