DATAJDBC-431 - Polishing.

Improved and corrected nullability annotations. Fixed broken Javadoc.

Original pull request: #175.
This commit is contained in:
Jens Schauder
2019-10-15 14:02:44 +02:00
committed by Mark Paluch
parent 1774e3a3a7
commit 3e4e874aa8
3 changed files with 4 additions and 3 deletions

View File

@@ -58,6 +58,7 @@ public interface DataAccessStrategy extends RelationResolver {
* @return the id generated by the database if any.
* @since 1.1
*/
@Nullable
default <T> Object insert(T instance, Class<T> domainType, Identifier identifier) {
return insert(instance, domainType, identifier.toMap());
}

View File

@@ -313,7 +313,7 @@ public class DefaultDataAccessStrategy implements DataAccessStrategy {
return result;
}
private <S, T> MapSqlParameterSource getParameterSource(S instance, RelationalPersistentEntity<S> persistentEntity,
private <S, T> MapSqlParameterSource getParameterSource(@Nullable S instance, RelationalPersistentEntity<S> persistentEntity,
String prefix, Predicate<RelationalPersistentProperty> skipProperty) {
MapSqlParameterSource parameters = new MapSqlParameterSource();
@@ -418,7 +418,7 @@ public class DefaultDataAccessStrategy implements DataAccessStrategy {
}
private void addConvertedPropertyValue(MapSqlParameterSource parameterSource, RelationalPersistentProperty property,
Object value, String paramName) {
@Nullable Object value, String paramName) {
JdbcValue jdbcValue = converter.writeJdbcValue( //
value, //

View File

@@ -27,7 +27,7 @@ import java.lang.annotation.Target;
/**
* Run the annotated test only against a HsqlDb database.
*
* Requires the use of
* Requires the use of {@code @ProfileValueSourceConfiguration(DatabaseProfileValueSource.class)} on the test.
*
* @author Jens Schauder
*/