Revert "Improve generic type handling in RepositoryItemReader"
This reverts commit a30aaac4be
which had the side effect of no longer being able to use queries
in `RepositoryItemReader` that return a different type than the
repository's entity type.
Resolves #4164
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -76,14 +76,13 @@ import org.springframework.util.MethodInvoker;
|
||||
*
|
||||
* @author Michael Minella
|
||||
* @author Antoine Kapps
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @since 2.2
|
||||
*/
|
||||
public class RepositoryItemReader<T> extends AbstractItemCountingItemStreamItemReader<T> implements InitializingBean {
|
||||
|
||||
protected Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private PagingAndSortingRepository<T, ?> repository;
|
||||
private PagingAndSortingRepository<?, ?> repository;
|
||||
|
||||
private Sort sort;
|
||||
|
||||
@@ -133,7 +132,7 @@ public class RepositoryItemReader<T> extends AbstractItemCountingItemStreamItemR
|
||||
* implementation used to read input from.
|
||||
* @param repository underlying repository for input to be read from.
|
||||
*/
|
||||
public void setRepository(PagingAndSortingRepository<T, ?> repository) {
|
||||
public void setRepository(PagingAndSortingRepository<?, ?> repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class RepositoryItemReaderBuilder<T> {
|
||||
|
||||
private PagingAndSortingRepository<T, ?> repository;
|
||||
private PagingAndSortingRepository<?, ?> repository;
|
||||
|
||||
private Map<String, Sort.Direction> sorts;
|
||||
|
||||
@@ -165,7 +165,7 @@ public class RepositoryItemReaderBuilder<T> {
|
||||
* @return The current instance of the builder.
|
||||
* @see RepositoryItemReader#setRepository(PagingAndSortingRepository)
|
||||
*/
|
||||
public RepositoryItemReaderBuilder<T> repository(PagingAndSortingRepository<T, ?> repository) {
|
||||
public RepositoryItemReaderBuilder<T> repository(PagingAndSortingRepository<?, ?> repository) {
|
||||
this.repository = repository;
|
||||
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user