Skip to content

Commit 86630f3

Browse files
committed
moved programmatic transaction examples from spring-data-jpa-3 to spring-data-jpa-4
1 parent 40f7559 commit 86630f3

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

persistence-modules/spring-data-jpa-3/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
- [Batch Insert/Update with Hibernate/JPA](https://www.baeldung.com/jpa-hibernate-batch-insert-update)
1111
- [Difference Between save() and saveAndFlush() in Spring Data JPA](https://www.baeldung.com/spring-data-jpa-save-saveandflush)
1212

13-
- [Programmatic Transaction Management in Spring](https://www.baeldung.com/spring-programmatic-transaction-management)
14-
1513
### Eclipse Config
1614
After importing the project into Eclipse, you may see the following error:
1715
"No persistence xml file found in project"

persistence-modules/spring-data-jpa-4/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- [Derived Query Methods in Spring Data JPA Repositories](https://www.baeldung.com/spring-data-derived-queries)
33
- [LIKE Queries in Spring JPA Repositories](https://www.baeldung.com/spring-jpa-like-queries)
44
- [A Guide to Spring’s Open Session In View](https://www.baeldung.com/spring-open-session-in-view)
5+
- [Programmatic Transaction Management in Spring](https://www.baeldung.com/spring-programmatic-transaction-management)
56

67
### Eclipse Config
78
After importing the project into Eclipse, you may see the following error:
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void givenAPayment_WhenMarkAsRollback_ThenShouldRollback() {
7777
});
7878

7979
assertThat(entityManager
80-
.createQuery("select p from Payment p")
80+
.createQuery("select p from Payment p", Payment.class)
8181
.getResultList()).isEmpty();
8282
}
8383

@@ -104,7 +104,7 @@ void givenTwoPayments_WhenRefIsDuplicate_ThenShouldRollback() {
104104
}
105105

106106
assertThat(entityManager
107-
.createQuery("select p from Payment p")
107+
.createQuery("select p from Payment p", Payment.class)
108108
.getResultList()).isEmpty();
109109
}
110110

@@ -122,7 +122,7 @@ protected void doInTransactionWithoutResult(TransactionStatus status) {
122122
});
123123

124124
assertThat(entityManager
125-
.createQuery("select p from Payment p")
125+
.createQuery("select p from Payment p", Payment.class)
126126
.getResultList()).hasSize(1);
127127
}
128128

@@ -145,7 +145,7 @@ void givenAPayment_WhenUsingTxManager_ThenShouldCommit() {
145145
}
146146

147147
assertThat(entityManager
148-
.createQuery("select p from Payment p")
148+
.createQuery("select p from Payment p", Payment.class)
149149
.getResultList()).hasSize(1);
150150
}
151151

0 commit comments

Comments
 (0)