Skip to content

Commit 3e4e874

Browse files
schaudermp911de
authored andcommitted
DATAJDBC-431 - Polishing.
Improved and corrected nullability annotations. Fixed broken Javadoc. Original pull request: #175.
1 parent 1774e3a commit 3e4e874

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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, //

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/testing/HsqlDbOnly.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/**
2828
* Run the annotated test only against a HsqlDb database.
2929
*
30-
* Requires the use of
30+
* Requires the use of {@code @ProfileValueSourceConfiguration(DatabaseProfileValueSource.class)} on the test.
3131
*
3232
* @author Jens Schauder
3333
*/

0 commit comments

Comments
 (0)