1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.executor;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.apache.ibatis.mapping.MappedStatement;
22
23
24
25
26 public class BatchResult {
27
28 private final MappedStatement mappedStatement;
29 private final String sql;
30 private final List<Object> parameterObjects;
31
32 private int[] updateCounts;
33
34 public BatchResult(MappedStatement mappedStatement, String sql) {
35 this.mappedStatement = mappedStatement;
36 this.sql = sql;
37 this.parameterObjects = new ArrayList<>();
38 }
39
40 public BatchResult(MappedStatement mappedStatement, String sql, Object parameterObject) {
41 this(mappedStatement, sql);
42 addParameterObject(parameterObject);
43 }
44
45 public MappedStatement getMappedStatement() {
46 return mappedStatement;
47 }
48
49 public String getSql() {
50 return sql;
51 }
52
53 @Deprecated
54 public Object getParameterObject() {
55 return parameterObjects.get(0);
56 }
57
58 public List<Object> getParameterObjects() {
59 return parameterObjects;
60 }
61
62 public int[] getUpdateCounts() {
63 return updateCounts;
64 }
65
66 public void setUpdateCounts(int[] updateCounts) {
67 this.updateCounts = updateCounts;
68 }
69
70 public void addParameterObject(Object parameterObject) {
71 this.parameterObjects.add(parameterObject);
72 }
73
74 }