View Javadoc
1   /*
2    * SPDX-License-Identifier: Apache-2.0
3    * See LICENSE file for details.
4    *
5    * Copyright 2015-2026 the original author or authors.
6    */
7   package org.springframework.orm.ibatis;
8   
9   import com.ibatis.sqlmap.client.event.RowHandler;
10  
11  import java.util.List;
12  import java.util.Map;
13  
14  import org.springframework.dao.DataAccessException;
15  
16  /**
17   * Interface that specifies a basic set of iBATIS SqlMapClient operations, implemented by {@link SqlMapClientTemplate}.
18   * Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.
19   * <p>
20   * Defines SqlMapClientTemplate's convenience methods that mirror the iBATIS
21   * {@link com.ibatis.sqlmap.client.SqlMapExecutor}'s execution methods. Users are strongly encouraged to read the iBATIS
22   * javadocs for details on the semantics of those methods.
23   *
24   * @author Juergen Hoeller
25   *
26   * @since 24.02.2004
27   *
28   * @see SqlMapClientTemplate
29   * @see com.ibatis.sqlmap.client.SqlMapClient
30   * @see com.ibatis.sqlmap.client.SqlMapExecutor
31   *
32   * @deprecated as of Spring 3.2, in favor of the native Spring support in the Mybatis follow-up project
33   *             (https://mybatis.org/)
34   */
35  @Deprecated
36  public interface SqlMapClientOperations {
37  
38    /**
39     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForObject(String)
40     *
41     * @throws org.springframework.dao.DataAccessException
42     *           in case of errors
43     */
44    Object queryForObject(String statementName) throws DataAccessException;
45  
46    /**
47     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForObject(String, Object)
48     *
49     * @throws org.springframework.dao.DataAccessException
50     *           in case of errors
51     */
52    Object queryForObject(String statementName, Object parameterObject) throws DataAccessException;
53  
54    /**
55     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForObject(String, Object, Object)
56     *
57     * @throws org.springframework.dao.DataAccessException
58     *           in case of errors
59     */
60    Object queryForObject(String statementName, Object parameterObject, Object resultObject) throws DataAccessException;
61  
62    /**
63     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForList(String)
64     *
65     * @throws org.springframework.dao.DataAccessException
66     *           in case of errors
67     */
68    @SuppressWarnings("rawtypes")
69    List queryForList(String statementName) throws DataAccessException;
70  
71    /**
72     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForList(String, Object)
73     *
74     * @throws org.springframework.dao.DataAccessException
75     *           in case of errors
76     */
77    @SuppressWarnings("rawtypes")
78    List queryForList(String statementName, Object parameterObject) throws DataAccessException;
79  
80    /**
81     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForList(String, int, int)
82     *
83     * @throws org.springframework.dao.DataAccessException
84     *           in case of errors
85     */
86    @SuppressWarnings("rawtypes")
87    List queryForList(String statementName, int skipResults, int maxResults) throws DataAccessException;
88  
89    /**
90     * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForList(String, Object, int, int)
91     *
92     * @throws org.springframework.dao.DataAccessException
93     *           in case of errors
94     */
95    @SuppressWarnings("rawtypes")
96    List queryForList(String statementName, Object parameterObject, int skipResults, int maxResults)
97        throws DataAccessException;
98  
99    /**
100    * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryWithRowHandler(String, RowHandler)
101    *
102    * @throws org.springframework.dao.DataAccessException
103    *           in case of errors
104    */
105   void queryWithRowHandler(String statementName, RowHandler rowHandler) throws DataAccessException;
106 
107   /**
108    * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryWithRowHandler(String, Object, RowHandler)
109    *
110    * @throws org.springframework.dao.DataAccessException
111    *           in case of errors
112    */
113   void queryWithRowHandler(String statementName, Object parameterObject, RowHandler rowHandler)
114       throws DataAccessException;
115 
116   /**
117    * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForMap(String, Object, String)
118    *
119    * @throws org.springframework.dao.DataAccessException
120    *           in case of errors
121    */
122   @SuppressWarnings("rawtypes")
123   Map queryForMap(String statementName, Object parameterObject, String keyProperty) throws DataAccessException;
124 
125   /**
126    * @see com.ibatis.sqlmap.client.SqlMapExecutor#queryForMap(String, Object, String, String)
127    *
128    * @throws org.springframework.dao.DataAccessException
129    *           in case of errors
130    */
131   @SuppressWarnings("rawtypes")
132   Map queryForMap(String statementName, Object parameterObject, String keyProperty, String valueProperty)
133       throws DataAccessException;
134 
135   /**
136    * @see com.ibatis.sqlmap.client.SqlMapExecutor#insert(String)
137    *
138    * @throws org.springframework.dao.DataAccessException
139    *           in case of errors
140    */
141   Object insert(String statementName) throws DataAccessException;
142 
143   /**
144    * @see com.ibatis.sqlmap.client.SqlMapExecutor#insert(String, Object)
145    *
146    * @throws org.springframework.dao.DataAccessException
147    *           in case of errors
148    */
149   Object insert(String statementName, Object parameterObject) throws DataAccessException;
150 
151   /**
152    * @see com.ibatis.sqlmap.client.SqlMapExecutor#update(String)
153    *
154    * @throws org.springframework.dao.DataAccessException
155    *           in case of errors
156    */
157   int update(String statementName) throws DataAccessException;
158 
159   /**
160    * @see com.ibatis.sqlmap.client.SqlMapExecutor#update(String, Object)
161    *
162    * @throws org.springframework.dao.DataAccessException
163    *           in case of errors
164    */
165   int update(String statementName, Object parameterObject) throws DataAccessException;
166 
167   /**
168    * Convenience method provided by Spring: execute an update operation with an automatic check that the update affected
169    * the given required number of rows.
170    *
171    * @param statementName
172    *          the name of the mapped statement
173    * @param parameterObject
174    *          the parameter object
175    * @param requiredRowsAffected
176    *          the number of rows that the update is required to affect
177    *
178    * @throws org.springframework.dao.DataAccessException
179    *           in case of errors
180    */
181   void update(String statementName, Object parameterObject, int requiredRowsAffected) throws DataAccessException;
182 
183   /**
184    * @see com.ibatis.sqlmap.client.SqlMapExecutor#delete(String)
185    *
186    * @throws org.springframework.dao.DataAccessException
187    *           in case of errors
188    */
189   int delete(String statementName) throws DataAccessException;
190 
191   /**
192    * @see com.ibatis.sqlmap.client.SqlMapExecutor#delete(String, Object)
193    *
194    * @throws org.springframework.dao.DataAccessException
195    *           in case of errors
196    */
197   int delete(String statementName, Object parameterObject) throws DataAccessException;
198 
199   /**
200    * Convenience method provided by Spring: execute a delete operation with an automatic check that the delete affected
201    * the given required number of rows.
202    *
203    * @param statementName
204    *          the name of the mapped statement
205    * @param parameterObject
206    *          the parameter object
207    * @param requiredRowsAffected
208    *          the number of rows that the delete is required to affect
209    *
210    * @throws org.springframework.dao.DataAccessException
211    *           in case of errors
212    */
213   void delete(String statementName, Object parameterObject, int requiredRowsAffected) throws DataAccessException;
214 
215 }