You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JpaItemWriterBuilder.java
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2018 the original author or authors.
2
+
* Copyright 2018-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
30
30
publicclassJpaItemWriterBuilder<T> {
31
31
32
32
privateEntityManagerFactoryentityManagerFactory;
33
+
privatebooleanusePersist = false;
33
34
34
35
/**
35
36
* The JPA {@link EntityManagerFactory} to obtain an entity manager from. Required.
@@ -44,6 +45,19 @@ public JpaItemWriterBuilder<T> entityManagerFactory(EntityManagerFactory entityM
44
45
returnthis;
45
46
}
46
47
48
+
/**
49
+
* Set whether the entity manager should perform a persist instead of a merge.
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/builder/JpaItemWriterBuilderTests.java
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2018 the original author or authors.
2
+
* Copyright 2018-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -84,4 +84,22 @@ public void testValidation() {
84
84
assertEquals("Incorrect message", "EntityManagerFactory must be provided", ise.getMessage());
0 commit comments