Remove punctuation in Exception messages.

Closes #1259.
This commit is contained in:
John Blum
2022-06-08 11:58:32 -07:00
parent 6911bfba98
commit 483b30e8c2
103 changed files with 338 additions and 338 deletions

View File

@@ -120,8 +120,8 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
public R2dbcEntityTemplate r2dbcEntityTemplate(DatabaseClient databaseClient,
ReactiveDataAccessStrategy dataAccessStrategy) {
Assert.notNull(databaseClient, "DatabaseClient must not be null!");
Assert.notNull(dataAccessStrategy, "ReactiveDataAccessStrategy must not be null!");
Assert.notNull(databaseClient, "DatabaseClient must not be null");
Assert.notNull(dataAccessStrategy, "ReactiveDataAccessStrategy must not be null");
return new R2dbcEntityTemplate(databaseClient, dataAccessStrategy);
}
@@ -138,7 +138,7 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
public R2dbcMappingContext r2dbcMappingContext(Optional<NamingStrategy> namingStrategy,
R2dbcCustomConversions r2dbcCustomConversions) {
Assert.notNull(namingStrategy, "NamingStrategy must not be null!");
Assert.notNull(namingStrategy, "NamingStrategy must not be null");
R2dbcMappingContext context = new R2dbcMappingContext(namingStrategy.orElse(NamingStrategy.INSTANCE));
context.setSimpleTypeHolder(r2dbcCustomConversions.getSimpleTypeHolder());
@@ -159,7 +159,7 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
@Bean
public ReactiveDataAccessStrategy reactiveDataAccessStrategy(R2dbcConverter converter) {
Assert.notNull(converter, "MappingContext must not be null!");
Assert.notNull(converter, "MappingContext must not be null");
return new DefaultReactiveDataAccessStrategy(getDialect(lookupConnectionFactory()), converter);
}
@@ -180,7 +180,7 @@ public abstract class AbstractR2dbcConfiguration implements ApplicationContextAw
public MappingR2dbcConverter r2dbcConverter(R2dbcMappingContext mappingContext,
R2dbcCustomConversions r2dbcCustomConversions) {
Assert.notNull(mappingContext, "MappingContext must not be null!");
Assert.notNull(mappingContext, "MappingContext must not be null");
return new MappingR2dbcConverter(mappingContext, r2dbcCustomConversions);
}

View File

@@ -62,7 +62,7 @@ class R2dbcAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
@Override
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
Assert.notNull(configuration, "AuditingConfiguration must not be null");
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveIsNewAwareAuditingHandler.class);
@@ -81,8 +81,8 @@ class R2dbcAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
BeanDefinitionRegistry registry) {
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null");
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveAuditingEntityCallback.class);

View File

@@ -185,7 +185,7 @@ public class MappingR2dbcConverter extends BasicRelationalConverter implements R
return readValue(value, property.getTypeInformation());
} catch (Exception o_O) {
throw new MappingException(String.format("Could not read property %s from column %s!", property, identifier),
throw new MappingException(String.format("Could not read property %s from column %s", property, identifier),
o_O);
}
}
@@ -216,7 +216,7 @@ public class MappingR2dbcConverter extends BasicRelationalConverter implements R
@SuppressWarnings("unchecked")
private Object readCollectionOrArray(Collection<?> source, TypeInformation<?> targetType) {
Assert.notNull(targetType, "Target type must not be null!");
Assert.notNull(targetType, "Target type must not be null");
Class<?> collectionType = targetType.isSubTypeOf(Collection.class) //
? targetType.getType() //
@@ -240,7 +240,7 @@ public class MappingR2dbcConverter extends BasicRelationalConverter implements R
if (!Object.class.equals(rawComponentType) && element instanceof Collection) {
if (!rawComponentType.isArray() && !ClassUtils.isAssignable(Iterable.class, rawComponentType)) {
throw new MappingException(String.format(
"Cannot convert %1$s of type %2$s into an instance of %3$s! Implement a custom Converter<%2$s, %3$s> and register it with the CustomConversions",
"Cannot convert %1$s of type %2$s into an instance of %3$s; Implement a custom Converter<%2$s, %3$s> and register it with the CustomConversions",
element, element.getClass(), rawComponentType));
}
}
@@ -603,7 +603,7 @@ public class MappingR2dbcConverter extends BasicRelationalConverter implements R
@SuppressWarnings("unchecked")
public <T> BiFunction<Row, RowMetadata, T> populateIdIfNecessary(T object) {
Assert.notNull(object, "Entity object must not be null!");
Assert.notNull(object, "Entity object must not be null");
Class<?> userClass = ClassUtils.getUserClass(object);
RelationalPersistentEntity<?> entity = getMappingContext().getRequiredPersistentEntity(userClass);
@@ -744,7 +744,7 @@ public class MappingR2dbcConverter extends BasicRelationalConverter implements R
try {
return this.converter.getConversionService().convert(value, type);
} catch (Exception o_O) {
throw new MappingException(String.format("Couldn't read parameter %s.", parameter.getName()), o_O);
throw new MappingException(String.format("Couldn't read parameter %s", parameter.getName()), o_O);
}
}
}

View File

@@ -179,7 +179,7 @@ public class DefaultReactiveDataAccessStrategy implements ReactiveDataAccessStra
*/
public OutboundRow getOutboundRow(Object object) {
Assert.notNull(object, "Entity object must not be null!");
Assert.notNull(object, "Entity object must not be null");
OutboundRow row = new OutboundRow();

View File

@@ -80,7 +80,7 @@ class DefaultStatementMapper implements StatementMapper {
@SuppressWarnings("unchecked")
public <T> TypedStatementMapper<T> forType(Class<T> type) {
Assert.notNull(type, "Type must not be null!");
Assert.notNull(type, "Type must not be null");
return new DefaultTypedStatementMapper<>(
(RelationalPersistentEntity<T>) this.mappingContext.getRequiredPersistentEntity(type));

View File

@@ -64,8 +64,8 @@ class MapBindParameterSource implements BindParameterSource {
*/
MapBindParameterSource addValue(String paramName, Object value) {
Assert.notNull(paramName, "Parameter name must not be null!");
Assert.notNull(value, "Value must not be null!");
Assert.notNull(paramName, "Parameter name must not be null");
Assert.notNull(value, "Value must not be null");
this.values.put(paramName, Parameter.fromOrEmpty(value, value.getClass()));
return this;
@@ -78,7 +78,7 @@ class MapBindParameterSource implements BindParameterSource {
@Override
public boolean hasValue(String paramName) {
Assert.notNull(paramName, "Parameter name must not be null!");
Assert.notNull(paramName, "Parameter name must not be null");
return values.containsKey(paramName);
}
@@ -90,7 +90,7 @@ class MapBindParameterSource implements BindParameterSource {
@Override
public Class<?> getType(String paramName) {
Assert.notNull(paramName, "Parameter name must not be null!");
Assert.notNull(paramName, "Parameter name must not be null");
Parameter settableValue = this.values.get(paramName);
if (settableValue != null) {

View File

@@ -538,7 +538,7 @@ abstract class NamedParameterUtils {
Assert.isTrue(markers.hasNext(),
() -> String.format(
"No bind marker for value [%s] in SQL [%s]. Check that the query was expanded using the same arguments.",
"No bind marker for value [%s] in SQL [%s]; Check that the query was expanded using the same arguments",
valueToBind, toQuery()));
markers.next().bind(target, valueToBind);

View File

@@ -226,7 +226,7 @@ public class R2dbcEntityTemplate implements R2dbcEntityOperations, BeanFactoryAw
*/
public void setEntityCallbacks(ReactiveEntityCallbacks entityCallbacks) {
Assert.notNull(entityCallbacks, "EntityCallbacks must not be null!");
Assert.notNull(entityCallbacks, "EntityCallbacks must not be null");
this.entityCallbacks = entityCallbacks;
}
@@ -717,13 +717,13 @@ public class R2dbcEntityTemplate implements R2dbcEntityOperations, BeanFactoryAw
private <T> String formatOptimisticLockingExceptionMessage(T entity, RelationalPersistentEntity<T> persistentEntity) {
return String.format("Failed to update table [%s]. Version does not match for row with Id [%s].",
return String.format("Failed to update table [%s]; Version does not match for row with Id [%s]",
persistentEntity.getTableName(), persistentEntity.getIdentifierAccessor(entity).getIdentifier());
}
private <T> String formatTransientEntityExceptionMessage(T entity, RelationalPersistentEntity<T> persistentEntity) {
return String.format("Failed to update table [%s]. Row with Id [%s] does not exist.",
return String.format("Failed to update table [%s]; Row with Id [%s] does not exist",
persistentEntity.getTableName(), persistentEntity.getIdentifierAccessor(entity).getIdentifier());
}
@@ -812,7 +812,7 @@ public class R2dbcEntityTemplate implements R2dbcEntityOperations, BeanFactoryAw
private <T> Query getByIdQuery(T entity, RelationalPersistentEntity<?> persistentEntity) {
if (!persistentEntity.hasIdProperty()) {
throw new MappingException("No id property found for object of type " + persistentEntity.getType() + "!");
throw new MappingException("No id property found for object of type " + persistentEntity.getType());
}
IdentifierAccessor identifierAccessor = persistentEntity.getIdentifierAccessor(entity);

View File

@@ -135,7 +135,7 @@ public interface ReactiveDataAccessStrategy {
*/
default String renderForGeneratedValues(SqlIdentifier identifier) {
Assert.notNull(identifier, "SqlIdentifier must not be null.");
Assert.notNull(identifier, "SqlIdentifier must not be null");
return identifier.toSql(IdentifierProcessing.NONE);
}

View File

@@ -60,7 +60,7 @@ public class DialectResolver {
.findFirst() //
.orElseThrow(() -> {
return new NoDialectException(
String.format("Cannot determine a dialect for %s using %s. Please provide a Dialect.",
String.format("Cannot determine a dialect for %s using %s; Please provide a Dialect",
connectionFactory.getMetadata().getName(), connectionFactory));
});
}

View File

@@ -44,7 +44,7 @@ public class ReactiveAuditingEntityCallback implements BeforeConvertCallback<Obj
*/
public ReactiveAuditingEntityCallback(ObjectFactory<ReactiveIsNewAwareAuditingHandler> auditingHandlerFactory) {
Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null!");
Assert.notNull(auditingHandlerFactory, "IsNewAwareAuditingHandler must not be null");
this.auditingHandlerFactory = auditingHandlerFactory;
}

View File

@@ -34,8 +34,8 @@ public class BoundAssignments {
public BoundAssignments(Bindings bindings, List<Assignment> assignments) {
Assert.notNull(bindings, "Bindings must not be null!");
Assert.notNull(assignments, "Assignments must not be null!");
Assert.notNull(bindings, "Bindings must not be null");
Assert.notNull(assignments, "Assignments must not be null");
this.bindings = bindings;
this.assignments = assignments;

View File

@@ -32,8 +32,8 @@ public class BoundCondition {
public BoundCondition(Bindings bindings, Condition condition) {
Assert.notNull(bindings, "Bindings must not be null!");
Assert.notNull(condition, "Condition must not be null!");
Assert.notNull(bindings, "Bindings must not be null");
Assert.notNull(condition, "Condition must not be null");
this.bindings = bindings;
this.condition = condition;

View File

@@ -73,8 +73,8 @@ public class QueryMapper {
@SuppressWarnings({ "unchecked", "rawtypes" })
public QueryMapper(R2dbcDialect dialect, R2dbcConverter converter) {
Assert.notNull(converter, "R2dbcConverter must not be null!");
Assert.notNull(dialect, "R2dbcDialect must not be null!");
Assert.notNull(converter, "R2dbcConverter must not be null");
Assert.notNull(dialect, "R2dbcDialect must not be null");
this.converter = converter;
this.dialect = dialect;
@@ -199,9 +199,9 @@ public class QueryMapper {
public BoundCondition getMappedObject(BindMarkers markers, CriteriaDefinition criteria, Table table,
@Nullable RelationalPersistentEntity<?> entity) {
Assert.notNull(markers, "BindMarkers must not be null!");
Assert.notNull(criteria, "CriteriaDefinition must not be null!");
Assert.notNull(table, "Table must not be null!");
Assert.notNull(markers, "BindMarkers must not be null");
Assert.notNull(criteria, "CriteriaDefinition must not be null");
Assert.notNull(table, "Table must not be null");
MutableBindings bindings = new MutableBindings(markers);
@@ -228,9 +228,9 @@ public class QueryMapper {
public BoundCondition getMappedObject(BindMarkers markers, Criteria criteria, Table table,
@Nullable RelationalPersistentEntity<?> entity) {
Assert.notNull(markers, "BindMarkers must not be null!");
Assert.notNull(criteria, "Criteria must not be null!");
Assert.notNull(table, "Table must not be null!");
Assert.notNull(markers, "BindMarkers must not be null");
Assert.notNull(criteria, "Criteria must not be null");
Assert.notNull(table, "Table must not be null");
MutableBindings bindings = new MutableBindings(markers);
@@ -618,7 +618,7 @@ public class QueryMapper {
*/
public Field(SqlIdentifier name) {
Assert.notNull(name, "Name must not be null!");
Assert.notNull(name, "Name must not be null");
this.name = name;
}
@@ -674,7 +674,7 @@ public class QueryMapper {
super(name);
Assert.notNull(entity, "RelationalPersistentEntity must not be null!");
Assert.notNull(entity, "RelationalPersistentEntity must not be null");
this.entity = entity;
this.mappingContext = context;

View File

@@ -86,9 +86,9 @@ public class UpdateMapper extends QueryMapper {
public BoundAssignments getMappedObject(BindMarkers markers, Map<SqlIdentifier, ? extends Object> assignments,
Table table, @Nullable RelationalPersistentEntity<?> entity) {
Assert.notNull(markers, "BindMarkers must not be null!");
Assert.notNull(assignments, "Assignments must not be null!");
Assert.notNull(table, "Table must not be null!");
Assert.notNull(markers, "BindMarkers must not be null");
Assert.notNull(assignments, "Assignments must not be null");
Assert.notNull(table, "Table must not be null");
MutableBindings bindings = new MutableBindings(markers);
List<Assignment> result = new ArrayList<>();

View File

@@ -59,9 +59,9 @@ public abstract class AbstractR2dbcQuery implements RepositoryQuery {
*/
public AbstractR2dbcQuery(R2dbcQueryMethod method, R2dbcEntityOperations entityOperations, R2dbcConverter converter) {
Assert.notNull(method, "R2dbcQueryMethod must not be null!");
Assert.notNull(entityOperations, "R2dbcEntityOperations must not be null!");
Assert.notNull(converter, "R2dbcConverter must not be null!");
Assert.notNull(method, "R2dbcQueryMethod must not be null");
Assert.notNull(entityOperations, "R2dbcEntityOperations must not be null");
Assert.notNull(converter, "R2dbcConverter must not be null");
this.method = method;
this.entityOperations = entityOperations;

View File

@@ -71,7 +71,7 @@ public class PartTreeR2dbcQuery extends AbstractR2dbcQuery {
R2dbcQueryCreator.validate(this.tree, this.parameters);
} catch (RuntimeException e) {
throw new IllegalArgumentException(
String.format("Failed to create query for method %s! %s", method, e.getMessage()), e);
String.format("Failed to create query for method %s; %s", method, e.getMessage()), e);
}
}

View File

@@ -38,7 +38,7 @@ class PreparedOperationBindableQuery implements BindableQuery {
*/
PreparedOperationBindableQuery(PreparedOperation<?> preparedQuery) {
Assert.notNull(preparedQuery, "Prepared query must not be null!");
Assert.notNull(preparedQuery, "Prepared query must not be null");
this.preparedQuery = preparedQuery;
}

View File

@@ -85,7 +85,7 @@ public class R2dbcQueryMethod extends QueryMethod {
super(method, metadata, projectionFactory);
Assert.notNull(mappingContext, "MappingContext must not be null!");
Assert.notNull(mappingContext, "MappingContext must not be null");
this.mappingContext = mappingContext;
@@ -100,19 +100,19 @@ public class R2dbcQueryMethod extends QueryMethod {
if (singleWrapperWithWrappedPageableResult) {
throw new InvalidDataAccessApiUsageException(
String.format("'%s.%s' must not use sliced or paged execution. Please use Flux.buffer(size, skip).",
String.format("'%s.%s' must not use sliced or paged execution; Please use Flux.buffer(size, skip)",
ClassUtils.getShortName(method.getDeclaringClass()), method.getName()));
}
if (!multiWrapper) {
throw new IllegalStateException(String.format(
"Method has to use a either multi-item reactive wrapper return type or a wrapped Page/Slice type. Offending method: %s",
"Method has to use a either multi-item reactive wrapper return type or a wrapped Page/Slice type; Offending method: %s",
method.toString()));
}
if (hasParameterOfType(method, Sort.class)) {
throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameter. "
+ "Use sorting capabilities on Pageable instead! Offending method: %s", method.toString()));
throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameter; "
+ "Use sorting capabilities on Pageable instead; Offending method: %s", method.toString()));
}
}

View File

@@ -70,8 +70,8 @@ public class R2dbcRepositoryFactory extends ReactiveRepositoryFactorySupport {
*/
public R2dbcRepositoryFactory(DatabaseClient databaseClient, ReactiveDataAccessStrategy dataAccessStrategy) {
Assert.notNull(databaseClient, "DatabaseClient must not be null!");
Assert.notNull(dataAccessStrategy, "ReactiveDataAccessStrategy must not be null!");
Assert.notNull(databaseClient, "DatabaseClient must not be null");
Assert.notNull(dataAccessStrategy, "ReactiveDataAccessStrategy must not be null");
this.databaseClient = databaseClient;
this.dataAccessStrategy = dataAccessStrategy;
@@ -89,7 +89,7 @@ public class R2dbcRepositoryFactory extends ReactiveRepositoryFactorySupport {
*/
public R2dbcRepositoryFactory(R2dbcEntityOperations operations) {
Assert.notNull(operations, "R2dbcEntityOperations must not be null!");
Assert.notNull(operations, "R2dbcEntityOperations must not be null");
this.databaseClient = operations.getDatabaseClient();
this.dataAccessStrategy = operations.getDataAccessStrategy();

View File

@@ -157,9 +157,9 @@ public class R2dbcRepositoryFactoryBean<T extends Repository<S, ID>, S, ID exten
if (operations == null) {
Assert.state(client != null, "DatabaseClient must not be null when R2dbcEntityOperations is not configured!");
Assert.state(client != null, "DatabaseClient must not be null when R2dbcEntityOperations is not configured");
Assert.state(dataAccessStrategy != null,
"ReactiveDataAccessStrategy must not be null when R2dbcEntityOperations is not configured!");
"ReactiveDataAccessStrategy must not be null when R2dbcEntityOperations is not configured");
R2dbcEntityTemplate template = new R2dbcEntityTemplate(client, dataAccessStrategy);

View File

@@ -50,7 +50,7 @@ abstract class ReactiveFluentQuerySupport<P, T> implements FluentQuery.ReactiveF
@Override
public ReactiveFluentQuery<T> sortBy(Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
return create(predicate, sort, resultType, fieldsToInclude);
}
@@ -62,7 +62,7 @@ abstract class ReactiveFluentQuerySupport<P, T> implements FluentQuery.ReactiveF
@Override
public <R> ReactiveFluentQuery<R> as(Class<R> projection) {
Assert.notNull(projection, "Projection target type must not be null!");
Assert.notNull(projection, "Projection target type must not be null");
return create(predicate, sort, projection, fieldsToInclude);
}
@@ -74,7 +74,7 @@ abstract class ReactiveFluentQuerySupport<P, T> implements FluentQuery.ReactiveF
@Override
public ReactiveFluentQuery<T> project(Collection<String> properties) {
Assert.notNull(properties, "Projection properties must not be null!");
Assert.notNull(properties, "Projection properties must not be null");
return create(predicate, sort, resultType, new ArrayList<>(properties));
}

View File

@@ -47,9 +47,9 @@ abstract class ReactivePageableExecutionUtils {
*/
public static <T> Mono<Page<T>> getPage(List<T> content, Pageable pageable, Mono<Long> totalSupplier) {
Assert.notNull(content, "Content must not be null!");
Assert.notNull(pageable, "Pageable must not be null!");
Assert.notNull(totalSupplier, "TotalSupplier must not be null!");
Assert.notNull(content, "Content must not be null");
Assert.notNull(pageable, "Pageable must not be null");
Assert.notNull(totalSupplier, "TotalSupplier must not be null");
if (pageable.isUnpaged() || pageable.getOffset() == 0) {

View File

@@ -117,7 +117,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public <S extends T> Mono<S> save(S objectToSave) {
Assert.notNull(objectToSave, "Object to save must not be null!");
Assert.notNull(objectToSave, "Object to save must not be null");
if (this.entity.isNew(objectToSave)) {
return this.entityOperations.insert(objectToSave);
@@ -134,7 +134,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public <S extends T> Flux<S> saveAll(Iterable<S> objectsToSave) {
Assert.notNull(objectsToSave, "Objects to save must not be null!");
Assert.notNull(objectsToSave, "Objects to save must not be null");
return Flux.fromIterable(objectsToSave).concatMap(this::save);
}
@@ -147,7 +147,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public <S extends T> Flux<S> saveAll(Publisher<S> objectsToSave) {
Assert.notNull(objectsToSave, "Object publisher must not be null!");
Assert.notNull(objectsToSave, "Object publisher must not be null");
return Flux.from(objectsToSave).concatMap(this::save);
}
@@ -159,7 +159,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Mono<T> findById(ID id) {
Assert.notNull(id, "Id must not be null!");
Assert.notNull(id, "Id must not be null");
return this.entityOperations.selectOne(getIdQuery(id), this.entity.getJavaType());
}
@@ -180,7 +180,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Mono<Boolean> existsById(ID id) {
Assert.notNull(id, "Id must not be null!");
Assert.notNull(id, "Id must not be null");
return this.entityOperations.exists(getIdQuery(id), this.entity.getJavaType());
}
@@ -210,7 +210,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Flux<T> findAllById(Iterable<ID> iterable) {
Assert.notNull(iterable, "The iterable of Id's must not be null!");
Assert.notNull(iterable, "The iterable of Id's must not be null");
return findAllById(Flux.fromIterable(iterable));
}
@@ -222,7 +222,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Flux<T> findAllById(Publisher<ID> idPublisher) {
Assert.notNull(idPublisher, "The Id Publisher must not be null!");
Assert.notNull(idPublisher, "The Id Publisher must not be null");
return Flux.from(idPublisher).buffer().filter(ids -> !ids.isEmpty()).concatMap(ids -> {
@@ -253,7 +253,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public Mono<Void> deleteById(ID id) {
Assert.notNull(id, "Id must not be null!");
Assert.notNull(id, "Id must not be null");
return this.entityOperations.delete(getIdQuery(id), this.entity.getJavaType()).then();
}
@@ -266,7 +266,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public Mono<Void> deleteById(Publisher<ID> idPublisher) {
Assert.notNull(idPublisher, "The Id Publisher must not be null!");
Assert.notNull(idPublisher, "The Id Publisher must not be null");
return Flux.from(idPublisher).buffer().filter(ids -> !ids.isEmpty()).concatMap(ids -> {
@@ -288,7 +288,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public Mono<Void> delete(T objectToDelete) {
Assert.notNull(objectToDelete, "Object to delete must not be null!");
Assert.notNull(objectToDelete, "Object to delete must not be null");
return deleteById(this.entity.getRequiredId(objectToDelete));
}
@@ -300,7 +300,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Mono<Void> deleteAllById(Iterable<? extends ID> ids) {
Assert.notNull(ids, "The iterable of Id's must not be null!");
Assert.notNull(ids, "The iterable of Id's must not be null");
List<? extends ID> idsList = Streamable.of(ids).toList();
String idProperty = getIdProperty().getName();
@@ -316,7 +316,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public Mono<Void> deleteAll(Iterable<? extends T> iterable) {
Assert.notNull(iterable, "The iterable of Id's must not be null!");
Assert.notNull(iterable, "The iterable of Id's must not be null");
return deleteAll(Flux.fromIterable(iterable));
}
@@ -329,7 +329,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Transactional
public Mono<Void> deleteAll(Publisher<? extends T> objectPublisher) {
Assert.notNull(objectPublisher, "The Object Publisher must not be null!");
Assert.notNull(objectPublisher, "The Object Publisher must not be null");
Flux<ID> idPublisher = Flux.from(objectPublisher) //
.map(this.entity::getRequiredId);
@@ -358,7 +358,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Flux<T> findAll(Sort sort) {
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(sort, "Sort must not be null");
return this.entityOperations.select(Query.empty().sort(sort), this.entity.getJavaType());
}
@@ -370,7 +370,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public <S extends T> Mono<S> findOne(Example<S> example) {
Assert.notNull(example, "Example must not be null!");
Assert.notNull(example, "Example must not be null");
Query query = this.exampleMapper.getMappedExample(example);
@@ -380,7 +380,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public <S extends T> Flux<S> findAll(Example<S> example) {
Assert.notNull(example, "Example must not be null!");
Assert.notNull(example, "Example must not be null");
return findAll(example, Sort.unsorted());
}
@@ -388,8 +388,8 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public <S extends T> Flux<S> findAll(Example<S> example, Sort sort) {
Assert.notNull(example, "Example must not be null!");
Assert.notNull(sort, "Sort must not be null!");
Assert.notNull(example, "Example must not be null");
Assert.notNull(sort, "Sort must not be null");
Query query = this.exampleMapper.getMappedExample(example).sort(sort);
@@ -399,7 +399,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public <S extends T> Mono<Long> count(Example<S> example) {
Assert.notNull(example, "Example must not be null!");
Assert.notNull(example, "Example must not be null");
Query query = this.exampleMapper.getMappedExample(example);
@@ -409,7 +409,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public <S extends T> Mono<Boolean> exists(Example<S> example) {
Assert.notNull(example, "Example must not be null!");
Assert.notNull(example, "Example must not be null");
Query query = this.exampleMapper.getMappedExample(example);
@@ -420,8 +420,8 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
public <S extends T, R, P extends Publisher<R>> P findBy(Example<S> example,
Function<FluentQuery.ReactiveFluentQuery<S>, P> queryFunction) {
Assert.notNull(example, "Sample must not be null!");
Assert.notNull(queryFunction, "Query function must not be null!");
Assert.notNull(example, "Sample must not be null");
Assert.notNull(queryFunction, "Query function must not be null");
return queryFunction.apply(new ReactiveFluentQueryByExample<>(example, example.getProbeType()));
}
@@ -490,7 +490,7 @@ public class SimpleR2dbcRepository<T, ID> implements R2dbcRepository<T, ID> {
@Override
public Mono<Page<T>> page(Pageable pageable) {
Assert.notNull(pageable, "Pageable must not be null!");
Assert.notNull(pageable, "Pageable must not be null");
Mono<List<T>> items = createQuery(q -> q.with(pageable)).all().collectList();

View File

@@ -117,7 +117,7 @@ public class H2SimpleR2dbcRepositoryIntegrationTests extends AbstractSimpleR2dbc
.verifyErrorSatisfies(actual -> {
assertThat(actual).isInstanceOf(TransientDataAccessException.class)
.hasMessage("Failed to update table [legoset]. Row with Id [9999] does not exist.");
.hasMessage("Failed to update table [legoset]; Row with Id [9999] does not exist");
});
}