public class RepositoryItemWriterBuilder<T>
extends java.lang.Object
RepositoryItemWriter
.RepositoryItemWriter
Modifier and Type | Class and Description |
---|---|
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.
|
Constructor and Description |
---|
RepositoryItemWriterBuilder() |
Modifier and Type | Method and Description |
---|---|
RepositoryItemWriter<T> |
build()
Builds the
RepositoryItemWriter . |
RepositoryItemWriterBuilder<T> |
methodName(java.lang.String methodName)
Specifies what method on the repository to call.
|
RepositoryItemWriterBuilder<T> |
repository(org.springframework.data.repository.CrudRepository<T,?> repository)
Set the
CrudRepository implementation
for persistence |
RepositoryItemWriterBuilder<T> |
repository(RepositoryItemWriterBuilder.RepositoryMethodReference repositoryMethodReference)
Specifies a repository and the type-safe method to call for the writer.
|
public RepositoryItemWriterBuilder<T> methodName(java.lang.String methodName)
methodName
- the name of the method to be used for saving the item.RepositoryItemWriter.setMethodName(String)
public RepositoryItemWriterBuilder<T> repository(org.springframework.data.repository.CrudRepository<T,?> repository)
CrudRepository
implementation
for persistencerepository
- the Spring Data repository to be setRepositoryItemWriter.setRepository(CrudRepository)
public RepositoryItemWriterBuilder<T> repository(RepositoryItemWriterBuilder.RepositoryMethodReference repositoryMethodReference)
Pageable
as the last
argument. This method can be used in place of repository(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.RepositoryItemWriter.setMethodName(String)
,
RepositoryItemWriter.setRepository(CrudRepository)
public RepositoryItemWriter<T> build()
RepositoryItemWriter
.RepositoryItemWriter