Skip to content

Commit f9700bf

Browse files
committed
DATAJDBC-431 - Polishing.
Improved and corrected nullability annotations.
1 parent 83487cf commit f9700bf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public interface DataAccessStrategy extends RelationResolver {
5858
* @return the id generated by the database if any.
5959
* @since 1.1
6060
*/
61+
@Nullable
6162
default <T> Object insert(T instance, Class<T> domainType, Identifier identifier) {
6263
return insert(instance, domainType, identifier.toMap());
6364
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public <T> boolean existsById(Object id, Class<T> domainType) {
313313
return result;
314314
}
315315

316-
private <S, T> MapSqlParameterSource getParameterSource(S instance, RelationalPersistentEntity<S> persistentEntity,
316+
private <S, T> MapSqlParameterSource getParameterSource(@Nullable S instance, RelationalPersistentEntity<S> persistentEntity,
317317
String prefix, Predicate<RelationalPersistentProperty> skipProperty) {
318318

319319
MapSqlParameterSource parameters = new MapSqlParameterSource();
@@ -418,7 +418,7 @@ private <T> MapSqlParameterSource createIdParameterSource(Object id, Class<T> do
418418
}
419419

420420
private void addConvertedPropertyValue(MapSqlParameterSource parameterSource, RelationalPersistentProperty property,
421-
Object value, String paramName) {
421+
@Nullable Object value, String paramName) {
422422

423423
JdbcValue jdbcValue = converter.writeJdbcValue( //
424424
value, //

0 commit comments

Comments
 (0)