File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
src/main/java/com/arangodb/springframework/transaction Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .arangodb .springframework .transaction ;
2
+
3
+ import org .springframework .transaction .PlatformTransactionManager ;
4
+ import org .springframework .transaction .interceptor .TransactionAttribute ;
5
+ import org .springframework .transaction .support .TransactionTemplate ;
6
+
7
+ import java .util .Collection ;
8
+ import java .util .Collections ;
9
+
10
+ public class TransactionAttributeTemplate extends TransactionTemplate implements TransactionAttribute {
11
+
12
+ private String qualifier ;
13
+ private Collection <String > labels = Collections .emptyList ();
14
+
15
+ public TransactionAttributeTemplate (PlatformTransactionManager transactionManager ) {
16
+ super (transactionManager );
17
+ }
18
+
19
+ @ Override
20
+ public String getQualifier () {
21
+ return qualifier ;
22
+ }
23
+
24
+ public void setQualifier (String qualifier ) {
25
+ this .qualifier = qualifier ;
26
+ }
27
+
28
+ @ Override
29
+ public Collection <String > getLabels () {
30
+ return labels ;
31
+ }
32
+
33
+ public void setLabels (Collection <String > labels ) {
34
+ this .labels = labels ;
35
+ }
36
+
37
+ @ Override
38
+ public boolean rollbackOn (Throwable ex ) {
39
+ return (ex instanceof RuntimeException || ex instanceof Error );
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments