Skip to content

Commit 89db774

Browse files
farazahmadkfmbenhassine
authored andcommitted
Update Javadoc regarding sort order in RepositoryItemReader
Issue #4462
1 parent b020f41 commit 89db774

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/RepositoryItemReader.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -117,7 +117,9 @@ public void setArguments(List<?> arguments) {
117117
}
118118

119119
/**
120-
* Provides ordering of the results so that order is maintained between paged queries
120+
* Provides ordering of the results so that order is maintained between paged queries.
121+
* Use a {@link java.util.LinkedHashMap} in case of multiple sort entries to keep the
122+
* order.
121123
* @param sorts the fields to sort by and the directions
122124
*/
123125
public void setSort(Map<String, Sort.Direction> sorts) {

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/builder/RepositoryItemReaderBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2023 the original author or authors.
2+
* Copyright 2017-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -130,6 +130,8 @@ public RepositoryItemReaderBuilder<T> arguments(Object... arguments) {
130130

131131
/**
132132
* Provides ordering of the results so that order is maintained between paged queries.
133+
* Use a {@link java.util.LinkedHashMap} in case of multiple sort entries to keep the
134+
* order.
133135
* @param sorts the fields to sort by and the directions.
134136
* @return The current instance of the builder.
135137
* @see RepositoryItemReader#setSort(Map)

0 commit comments

Comments
 (0)