1 /*
2 * Copyright 2004-2025 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.ibatis.sqlmap.engine.execution;
17
18 import java.io.Serializable;
19
20 /**
21 * This class holds the statement and row information for every successful batch executed by iBATIS.
22 *
23 * @author Jeff Butler
24 */
25 public class BatchResult implements Serializable {
26
27 private static final long serialVersionUID = 1L;
28
29 /** The sql. */
30 private String sql;
31
32 /** The statement id. */
33 private String statementId;
34
35 /** The update counts. */
36 private int[] updateCounts;
37
38 /**
39 * Instantiates a new batch result.
40 *
41 * @param statementId
42 * the statement id
43 * @param sql
44 * the sql
45 */
46 public BatchResult(String statementId, String sql) {
47 super();
48 this.statementId = statementId;
49 this.sql = sql;
50 }
51
52 /**
53 * Gets the sql.
54 *
55 * @return the sql
56 */
57 public String getSql() {
58 return sql;
59 }
60
61 /**
62 * Gets the update counts.
63 *
64 * @return the update counts
65 */
66 public int[] getUpdateCounts() {
67 return updateCounts;
68 }
69
70 /**
71 * Sets the update counts.
72 *
73 * @param updateCounts
74 * the new update counts
75 */
76 public void setUpdateCounts(int[] updateCounts) {
77 this.updateCounts = updateCounts;
78 }
79
80 /**
81 * Gets the statement id.
82 *
83 * @return the statement id
84 */
85 public String getStatementId() {
86 return statementId;
87 }
88 }