类 RepositoryItemWriterBuilder<T>
- java.lang.Object
- org.springframework.batch.item.data.builder.RepositoryItemWriterBuilder<T>
public class RepositoryItemWriterBuilder<T> extends java.lang.Object
A builder implementation for theRepositoryItemWriter
.- 从以下版本开始:
- 4.0
- 作者:
- Glenn Renfro
- 另请参阅:
RepositoryItemWriter
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
RepositoryItemWriterBuilder.RepositoryMethodReference<T>
Establishes a proxy that will capture a the Repository and the associated methodName that will be used by the writer.
构造器概要
构造器 构造器 说明 RepositoryItemWriterBuilder()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 RepositoryItemWriter<T>
build()
Builds theRepositoryItemWriter
.RepositoryItemWriterBuilder<T>
methodName(java.lang.String methodName)
Specifies what method on the repository to call.RepositoryItemWriterBuilder<T>
repository(RepositoryItemWriterBuilder.RepositoryMethodReference repositoryMethodReference)
Specifies a repository and the type-safe method to call for the writer.RepositoryItemWriterBuilder<T>
repository(org.springframework.data.repository.CrudRepository<T,?> repository)
Set theCrudRepository
implementation for persistence
构造器详细资料
RepositoryItemWriterBuilder
public RepositoryItemWriterBuilder()
方法详细资料
methodName
public RepositoryItemWriterBuilder<T> methodName(java.lang.String methodName)
Specifies what method on the repository to call. This method must have the type of object passed to this writer as the sole argument.- 参数:
methodName
- the name of the method to be used for saving the item.- 返回:
- The current instance of the builder.
- 另请参阅:
RepositoryItemWriter.setMethodName(String)
repository
public RepositoryItemWriterBuilder<T> repository(org.springframework.data.repository.CrudRepository<T,?> repository)
Set theCrudRepository
implementation for persistence- 参数:
repository
- the Spring Data repository to be set- 返回:
- The current instance of the builder.
- 另请参阅:
RepositoryItemWriter.setRepository(CrudRepository)
repository
public RepositoryItemWriterBuilder<T> repository(RepositoryItemWriterBuilder.RepositoryMethodReference repositoryMethodReference)
Specifies a repository and the type-safe method to call for the writer. The method configured via this mechanism must takePageable
as the last argument. This method can be used in place ofrepository(CrudRepository)
,methodName(String)
}. Note: The repository that is used by the repositoryMethodReference must be non-final.- 参数:
repositoryMethodReference
- of the used to get a repository and type-safe method for use by the writer.- 返回:
- The current instance of the builder.
- 另请参阅:
RepositoryItemWriter.setMethodName(String)
,RepositoryItemWriter.setRepository(CrudRepository)
build
public RepositoryItemWriter<T> build()
Builds theRepositoryItemWriter
.- 返回:
- a
RepositoryItemWriter