Class JpaItemWriterBuilder<T>
java.lang.Object
org.springframework.batch.item.database.builder.JpaItemWriterBuilder<T>
A builder for the
JpaItemWriter
.- Since:
- 4.1
- Author:
- Mahmoud Ben Hassine
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a fully builtJpaItemWriter
.entityManagerFactory
(jakarta.persistence.EntityManagerFactory entityManagerFactory) The JPAEntityManagerFactory
to obtain an entity manager from.usePersist
(boolean usePersist) Set whether the entity manager should perform a persist instead of a merge.
-
Constructor Details
-
JpaItemWriterBuilder
public JpaItemWriterBuilder()
-
-
Method Details
-
entityManagerFactory
public JpaItemWriterBuilder<T> entityManagerFactory(jakarta.persistence.EntityManagerFactory entityManagerFactory) The JPAEntityManagerFactory
to obtain an entity manager from. Required.- Parameters:
entityManagerFactory
- theEntityManagerFactory
- Returns:
- this instance for method chaining
- See Also:
-
usePersist
Set whether the entity manager should perform a persist instead of a merge.- Parameters:
usePersist
- defaults to false- Returns:
- this instance for method chaining
- See Also:
-
build
Returns a fully builtJpaItemWriter
.- Returns:
- the writer
-