diff --git a/.gitignore b/.gitignore
index d9642d2c66..37d0ff8eee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
target/
.idea/
+.vscode/
.settings/
*.iml
.flattened-pom.xml
diff --git a/pom.xml b/pom.xml
index 98f945a6b2..296c68636a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.springframework.data
spring-data-relational-parent
- 4.0.0-SNAPSHOT
+ 4.0.0-1980-jspecify-SNAPSHOT
pom
Spring Data Relational Parent
diff --git a/spring-data-jdbc-distribution/pom.xml b/spring-data-jdbc-distribution/pom.xml
index b3c39e64c3..9a73f9bd9a 100644
--- a/spring-data-jdbc-distribution/pom.xml
+++ b/spring-data-jdbc-distribution/pom.xml
@@ -14,7 +14,7 @@
org.springframework.data
spring-data-relational-parent
- 4.0.0-SNAPSHOT
+ 4.0.0-1980-jspecify-SNAPSHOT
../pom.xml
diff --git a/spring-data-jdbc/pom.xml b/spring-data-jdbc/pom.xml
index e61fd64020..1db4d455ef 100644
--- a/spring-data-jdbc/pom.xml
+++ b/spring-data-jdbc/pom.xml
@@ -6,7 +6,7 @@
4.0.0
spring-data-jdbc
- 4.0.0-SNAPSHOT
+ 4.0.0-1980-jspecify-SNAPSHOT
Spring Data JDBC
Spring Data module for JDBC repositories.
@@ -15,7 +15,7 @@
org.springframework.data
spring-data-relational-parent
- 4.0.0-SNAPSHOT
+ 4.0.0-1980-jspecify-SNAPSHOT
diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/aot/JdbcRuntimeHints.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/aot/JdbcRuntimeHints.java
index 3a5eb3a73e..a788e59f6b 100644
--- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/aot/JdbcRuntimeHints.java
+++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/aot/JdbcRuntimeHints.java
@@ -17,6 +17,7 @@
import java.util.Arrays;
+import org.jspecify.annotations.Nullable;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
@@ -30,7 +31,6 @@
import org.springframework.data.relational.core.mapping.event.BeforeConvertCallback;
import org.springframework.data.relational.core.mapping.event.BeforeDeleteCallback;
import org.springframework.data.relational.core.mapping.event.BeforeSaveCallback;
-import org.springframework.lang.Nullable;
/**
* {@link RuntimeHintsRegistrar} for JDBC.
diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateChangeExecutionContext.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateChangeExecutionContext.java
index 75579d83a4..b1f33efcaa 100644
--- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateChangeExecutionContext.java
+++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateChangeExecutionContext.java
@@ -15,20 +15,12 @@
*/
package org.springframework.data.jdbc.core;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collectors;
+import org.jspecify.annotations.Nullable;
import org.springframework.dao.IncorrectUpdateSemanticsDataAccessException;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.data.jdbc.core.convert.DataAccessStrategy;
@@ -48,7 +40,6 @@
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
import org.springframework.data.relational.core.sql.LockMode;
import org.springframework.data.util.Pair;
-import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -82,8 +73,8 @@ class JdbcAggregateChangeExecutionContext {
void executeInsertRoot(DbAction.InsertRoot insert) {
- Object id = accessStrategy.insert(insert.getEntity(), insert.getEntityType(), Identifier.empty(),
- insert.getIdValueSource());
+ Object id = accessStrategy.insert(insert.entity(), insert.getEntityType(), Identifier.empty(),
+ insert.idValueSource());
add(new DbActionExecutionResult(insert, id));
}
@@ -91,7 +82,7 @@ void executeBatchInsertRoot(DbAction.BatchInsertRoot batchInsertRoot) {
List> inserts = batchInsertRoot.getActions();
List> insertSubjects = inserts.stream()
- .map(insert -> InsertSubject.describedBy(insert.getEntity(), Identifier.empty())).collect(Collectors.toList());
+ .map(insert -> InsertSubject.describedBy(insert.entity(), Identifier.empty())).collect(Collectors.toList());
Object[] ids = accessStrategy.insert(insertSubjects, batchInsertRoot.getEntityType(),
batchInsertRoot.getBatchValue());
@@ -104,8 +95,8 @@ void executeBatchInsertRoot(DbAction.BatchInsertRoot batchInsertRoot) {
void executeInsert(DbAction.Insert insert) {
Identifier parentKeys = getParentKeys(insert, converter);
- Object id = accessStrategy.insert(insert.getEntity(), insert.getEntityType(), parentKeys,
- insert.getIdValueSource());
+ Object id = accessStrategy.insert(insert.entity(), insert.getEntityType(), parentKeys,
+ insert.idValueSource());
add(new DbActionExecutionResult(insert, id));
}
@@ -113,7 +104,7 @@ void executeBatchInsert(DbAction.BatchInsert batchInsert) {
List> inserts = batchInsert.getActions();
List> insertSubjects = inserts.stream()
- .map(insert -> InsertSubject.describedBy(insert.getEntity(), getParentKeys(insert, converter)))
+ .map(insert -> InsertSubject.describedBy(insert.entity(), getParentKeys(insert, converter)))
.collect(Collectors.toList());
Object[] ids = accessStrategy.insert(insertSubjects, batchInsert.getEntityType(), batchInsert.getBatchValue());
@@ -135,27 +126,27 @@ void executeUpdateRoot(DbAction.UpdateRoot update) {
void executeDeleteRoot(DbAction.DeleteRoot delete) {
- if (delete.getPreviousVersion() != null) {
- accessStrategy.deleteWithVersion(delete.getId(), delete.getEntityType(), delete.getPreviousVersion());
+ if (delete.previousVersion() != null) {
+ accessStrategy.deleteWithVersion(delete.id(), delete.getEntityType(), delete.previousVersion());
} else {
- accessStrategy.delete(delete.getId(), delete.getEntityType());
+ accessStrategy.delete(delete.id(), delete.getEntityType());
}
}
void executeBatchDeleteRoot(DbAction.BatchDeleteRoot batchDelete) {
- List