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 super();
36 this.mappedStatement = mappedStatement;
37 this.sql = sql;
38 this.parameterObjects = new ArrayList<>();
39 }
40
41 public BatchResult(MappedStatement mappedStatement, String sql, Object parameterObject) {
42 this(mappedStatement, sql);
43 addParameterObject(parameterObject);
44 }
45
46 public MappedStatement getMappedStatement() {
47 return mappedStatement;
48 }
49
50 public String getSql() {
51 return sql;
52 }
53
54 @Deprecated
55 public Object getParameterObject() {
56 return parameterObjects.get(0);
57 }
58
59 public List<Object> getParameterObjects() {
60 return parameterObjects;
61 }
62
63 public int[] getUpdateCounts() {
64 return updateCounts;
65 }
66
67 public void setUpdateCounts(int[] updateCounts) {
68 this.updateCounts = updateCounts;
69 }
70
71 public void addParameterObject(Object parameterObject) {
72 this.parameterObjects.add(parameterObject);
73 }
74
75 }