Fix loading of nested embedded entities.

Closes #1676
Original pull request: #1685
This commit is contained in:
Jens Schauder
2023-12-04 14:47:57 +01:00
committed by Mark Paluch
parent 58d344a1a9
commit e5bcc4a155
2 changed files with 32 additions and 14 deletions

View File

@@ -114,6 +114,21 @@ public class JdbcRepositoryEmbeddedIntegrationTests {
.containsExactlyInAnyOrder(entity.getId(), other.getId());
}
@Test // GH-1676
public void findAllFindsAllEntitiesWithOnlyReferenceNotNull() {
DummyEntity entity = createDummyEntity();
entity.prefixedEmbeddable.test = null;
entity = repository.save(entity);
DummyEntity other = repository.save(createDummyEntity());
Iterable<DummyEntity> all = repository.findAll();
assertThat(all)//
.extracting(DummyEntity::getId)//
.containsExactlyInAnyOrder(entity.getId(), other.getId());
}
@Test // DATAJDBC-111
public void findByIdReturnsEmptyWhenNoneFound() {