Skip to content

Commit 8dbe21c

Browse files
committed
Polishing.
Formatting. Fixing SQL scripts. Original pull request #1956 See #831
1 parent 8f12e69 commit 8dbe21c

12 files changed

+131
-151
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/AggregateChangeExecutor.java

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ <T> void executeDelete(AggregateChange<T> aggregateChange) {
7878
}
7979

8080
private void execute(DbAction<?> action, JdbcAggregateChangeExecutionContext executionContext) {
81+
8182
if (action instanceof DbAction.InsertRoot<?> insertRoot) {
8283
executionContext.executeInsertRoot(insertRoot);
8384
} else if (action instanceof DbAction.BatchInsertRoot<?> batchInsertRoot) {

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/AbstractJdbcAggregateTemplateIntegrationTests.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import org.springframework.data.jdbc.testing.TestConfiguration;
5454
import org.springframework.data.jdbc.testing.TestDatabaseFeatures;
5555
import org.springframework.data.mapping.context.InvalidPersistentPropertyPath;
56-
import org.springframework.data.relational.core.conversion.DbActionExecutionException;
5756
import org.springframework.data.relational.core.mapping.Column;
5857
import org.springframework.data.relational.core.mapping.Embedded;
5958
import org.springframework.data.relational.core.mapping.InsertOnlyProperty;
@@ -317,7 +316,7 @@ void saveAndLoadManeEntitiesWithReferenceEntityLikeStream() {
317316

318317
Stream<LegoSet> streamable = template.streamAll(LegoSet.class);
319318

320-
assertThat(streamable)
319+
assertThat(streamable) //
321320
.extracting("id", "manual.id", "manual.content") //
322321
.containsExactly(tuple(legoSet.id, legoSet.manual.id, legoSet.manual.content));
323322
}
@@ -730,7 +729,7 @@ void saveAndLoadAnEntityWithArray() {
730729
void saveAndLoadAnEntityWithEmptyArray() {
731730

732731
ArrayOwner arrayOwner = new ArrayOwner();
733-
arrayOwner.digits = new String[] { };
732+
arrayOwner.digits = new String[] {};
734733

735734
ArrayOwner saved = template.save(arrayOwner);
736735

@@ -854,7 +853,7 @@ void saveAndLoadAnEntityWithSet() {
854853
assertThat(reloaded.digits).isEqualTo(new HashSet<>(asList("one", "two", "three")));
855854
}
856855

857-
@Test //GH-1737
856+
@Test // GH-1737
858857
@EnabledOnFeature(SUPPORTS_ARRAYS)
859858
void saveAndLoadEmbeddedArray() {
860859

@@ -869,7 +868,7 @@ void saveAndLoadEmbeddedArray() {
869868
assertThat(reloaded.embeddedStringList.digits).containsExactly("one", "two", "three");
870869
}
871870

872-
@Test //GH-1737
871+
@Test // GH-1737
873872
@EnabledOnFeature(SUPPORTS_ARRAYS)
874873
void saveAndLoadEmptyEmbeddedArray() {
875874

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryConcurrencyIntegrationTests.java

+7-13
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ DummyEntityRepository dummyEntityRepository(JdbcRepositoryFactory factory) {
7373
}
7474
}
7575

76-
@Autowired
77-
NamedParameterJdbcTemplate template;
78-
@Autowired
79-
DummyEntityRepository repository;
80-
@Autowired
81-
PlatformTransactionManager transactionManager;
76+
@Autowired NamedParameterJdbcTemplate template;
77+
@Autowired DummyEntityRepository repository;
78+
@Autowired PlatformTransactionManager transactionManager;
8279

8380
List<DummyEntity> concurrencyEntities;
8481
DummyEntity entity;
@@ -216,7 +213,7 @@ public void concurrentUpdateAndDeleteAll() throws Exception {
216213
}
217214

218215
private void executeInParallel(CountDownLatch startLatch, CountDownLatch doneLatch,
219-
UnaryOperator<DummyEntity> deleteAction, DummyEntity entity) {
216+
UnaryOperator<DummyEntity> deleteAction, DummyEntity entity) {
220217
// delete
221218
new Thread(() -> {
222219
try {
@@ -253,13 +250,11 @@ private static DummyEntity createDummyEntity() {
253250
return new DummyEntity(null, "Entity Name", new ArrayList<>());
254251
}
255252

256-
interface DummyEntityRepository extends CrudRepository<DummyEntity, Long> {
257-
}
253+
interface DummyEntityRepository extends CrudRepository<DummyEntity, Long> {}
258254

259255
static class DummyEntity {
260256

261-
@Id
262-
private Long id;
257+
@Id private Long id;
263258
String name;
264259
final List<Element> content;
265260

@@ -292,8 +287,7 @@ public DummyEntity withContent(List<Element> content) {
292287

293288
static class Element {
294289

295-
@Id
296-
private Long id;
290+
@Id private Long id;
297291
final Long content;
298292

299293
public Element(Long id, Long content) {

0 commit comments

Comments
 (0)