1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.guice.transactional;
17
18 import jakarta.transaction.Transaction;
19
20 public class TransactionToken {
21 private Transaction activeTransaction;
22 private Transaction suspendedTransaction;
23 private TransactionAttribute transactionAttribute;
24 private boolean isCompletionAllowed;
25
26 public TransactionToken(Transaction activeTransaction, Transaction suspendedTransaction,
27 TransactionAttribute transactionAttribute) {
28 this(activeTransaction, suspendedTransaction, transactionAttribute, false);
29 }
30
31 TransactionToken(Transaction activeTransaction, Transaction suspendedTransaction,
32 TransactionAttribute transactionAttribute, boolean isCompletionAllowed) {
33 this.activeTransaction = activeTransaction;
34 this.suspendedTransaction = suspendedTransaction;
35 this.transactionAttribute = transactionAttribute;
36 this.isCompletionAllowed = isCompletionAllowed;
37 }
38
39 public Transaction getActiveTransaction() {
40 return activeTransaction;
41 }
42
43 public void setActiveTransaction(Transaction activeTransaction) {
44 this.activeTransaction = activeTransaction;
45 }
46
47 public Transaction getSuspendedTransaction() {
48 return suspendedTransaction;
49 }
50
51 public void setSuspendedTransaction(Transaction suspendedTransaction) {
52 this.suspendedTransaction = suspendedTransaction;
53 }
54
55 public TransactionAttribute getTransactionAttribute() {
56 return transactionAttribute;
57 }
58
59 public void setTransactionStrategy(TransactionAttribute transactionAttribute) {
60 this.transactionAttribute = transactionAttribute;
61 }
62
63 public boolean isCompletionAllowed() {
64 return isCompletionAllowed;
65 }
66
67 public void setCompletionAllowed(boolean isCompletionAllowed) {
68 this.isCompletionAllowed = isCompletionAllowed;
69 }
70 }