View Javadoc
1   /*
2    * Copyright 2004-2023 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    /** The sql. */
28    private String sql;
29  
30    /** The statement id. */
31    private String statementId;
32  
33    /** The update counts. */
34    private int[] updateCounts;
35  
36    /**
37     * Instantiates a new batch result.
38     *
39     * @param statementId
40     *          the statement id
41     * @param sql
42     *          the sql
43     */
44    public BatchResult(String statementId, String sql) {
45      super();
46      this.statementId = statementId;
47      this.sql = sql;
48    }
49  
50    /**
51     * Gets the sql.
52     *
53     * @return the sql
54     */
55    public String getSql() {
56      return sql;
57    }
58  
59    /**
60     * Gets the update counts.
61     *
62     * @return the update counts
63     */
64    public int[] getUpdateCounts() {
65      return updateCounts;
66    }
67  
68    /**
69     * Sets the update counts.
70     *
71     * @param updateCounts
72     *          the new update counts
73     */
74    public void setUpdateCounts(int[] updateCounts) {
75      this.updateCounts = updateCounts;
76    }
77  
78    /**
79     * Gets the statement id.
80     *
81     * @return the statement id
82     */
83    public String getStatementId() {
84      return statementId;
85    }
86  }