Skip to content

Commit 2519096

Browse files
committed
DATAJPA-1818 - Polishing.
Add missing Transactional annotations. Original pull request: #435.
1 parent 76f216d commit 2519096

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public void delete(T entity) {
196196
* @see org.springframework.data.repository.CrudRepository#deleteAllById(java.lang.Iterable)
197197
*/
198198
@Override
199+
@Transactional
199200
public void deleteAllById(Iterable<? extends ID> ids) {
200201

201202
Assert.notNull(ids, "Ids must not be null!");
@@ -210,6 +211,7 @@ public void deleteAllById(Iterable<? extends ID> ids) {
210211
* @see org.springframework.data.repository.CrudRepository#deleteAllByIdInBatch(java.lang.Iterable)
211212
*/
212213
@Override
214+
@Transactional
213215
public void deleteAllByIdInBatch(Iterable<ID> ids) {
214216

215217
Assert.notNull(ids, "Ids must not be null!");
@@ -231,8 +233,8 @@ public void deleteAllByIdInBatch(Iterable<ID> ids) {
231233
* (non-Javadoc)
232234
* @see org.springframework.data.repository.CrudRepository#delete(java.lang.Iterable)
233235
*/
234-
@Transactional
235236
@Override
237+
@Transactional
236238
public void deleteAll(Iterable<? extends T> entities) {
237239

238240
Assert.notNull(entities, "Entities must not be null!");
@@ -246,8 +248,8 @@ public void deleteAll(Iterable<? extends T> entities) {
246248
* (non-Javadoc)
247249
* @see org.springframework.data.jpa.repository.JpaRepository#deleteInBatch(java.lang.Iterable)
248250
*/
249-
@Transactional
250251
@Override
252+
@Transactional
251253
public void deleteAllInBatch(Iterable<T> entities) {
252254

253255
Assert.notNull(entities, "Entities must not be null!");
@@ -264,8 +266,8 @@ public void deleteAllInBatch(Iterable<T> entities) {
264266
* (non-Javadoc)
265267
* @see org.springframework.data.repository.Repository#deleteAll()
266268
*/
267-
@Transactional
268269
@Override
270+
@Transactional
269271
public void deleteAll() {
270272

271273
for (T element : findAll()) {
@@ -277,8 +279,8 @@ public void deleteAll() {
277279
* (non-Javadoc)
278280
* @see org.springframework.data.jpa.repository.JpaRepository#deleteAllInBatch()
279281
*/
280-
@Transactional
281282
@Override
283+
@Transactional
282284
public void deleteAllInBatch() {
283285
em.createQuery(getDeleteAllQueryString()).executeUpdate();
284286
}

0 commit comments

Comments
 (0)