diff --git a/src/main/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriter.java b/src/main/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriter.java index ad65a460c..cec9c53ec 100644 --- a/src/main/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriter.java +++ b/src/main/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriter.java @@ -78,13 +78,13 @@ public class JdbcEntityWriter extends JdbcEntityWriterSupport { Update update = DbAction.update(o, propertyPath, dependingOn); aggregateChange.addAction(update); - referencedEntities(o).forEach( - propertyAndValue -> insertReferencedEntities(propertyAndValue, aggregateChange, propertyPath.nested(propertyAndValue.property.getName()), update)); + referencedEntities(o).forEach(propertyAndValue -> insertReferencedEntities(propertyAndValue, aggregateChange, + propertyPath.nested(propertyAndValue.property.getName()), update)); } } private void insertReferencedEntities(PropertyAndValue propertyAndValue, AggregateChange aggregateChange, - JdbcPropertyPath propertyPath, DbAction dependingOn) { + JdbcPropertyPath propertyPath, DbAction dependingOn) { Insert insert; if (propertyAndValue.property.isQualified()) { @@ -116,7 +116,7 @@ public class JdbcEntityWriter extends JdbcEntityWriterSupport { .flatMap( // p -> referencedEntity(p, persistentEntity.getPropertyAccessor(o)) // .map(e -> new PropertyAndValue(p, e)) // - ); + ); } private Stream referencedEntity(JdbcPersistentProperty p, PersistentPropertyAccessor propertyAccessor) { @@ -147,7 +147,7 @@ public class JdbcEntityWriter extends JdbcEntityWriterSupport { } private Stream collectionPropertyAsStream(JdbcPersistentProperty p, - PersistentPropertyAccessor propertyAccessor) { + PersistentPropertyAccessor propertyAccessor) { Object property = propertyAccessor.getProperty(p); @@ -160,7 +160,9 @@ public class JdbcEntityWriter extends JdbcEntityWriterSupport { Object property = propertyAccessor.getProperty(p); - if (property == null) return Stream.empty(); + if (property == null) { + return Stream.empty(); + } // ugly hackery since Java streams don't have a zip method. AtomicInteger index = new AtomicInteger(); diff --git a/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithListsIntegrationTests.java b/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithListsIntegrationTests.java index 23607d0fe..8c5c72e92 100644 --- a/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithListsIntegrationTests.java +++ b/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithListsIntegrationTests.java @@ -132,8 +132,6 @@ public class JdbcRepositoryWithListsIntegrationTests { Iterable reloaded = repository.findAll(); - reloaded.forEach(de -> System.out.println("id " + de.id + " content " + de.content.iterator().next().content)); - assertThat(reloaded) // .extracting(e -> e.id, e -> e.content.size()) // .containsExactly(tuple(entity.id, entity.content.size())); diff --git a/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithMapsIntegrationTests.java b/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithMapsIntegrationTests.java index b5e741910..f0efb19c0 100644 --- a/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithMapsIntegrationTests.java +++ b/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithMapsIntegrationTests.java @@ -127,8 +127,6 @@ public class JdbcRepositoryWithMapsIntegrationTests { Iterable reloaded = repository.findAll(); - reloaded.forEach(de -> System.out.println("id " + de.id + " content " + de.content.values().iterator().next().content)); - assertThat(reloaded) // .extracting(e -> e.id, e -> e.content.size()) // .containsExactly(tuple(entity.id, entity.content.size()));