KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > orm > ibatis > SqlMapOperations


1 /*
2  * Copyright 2002-2005 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  * http://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
17 package org.springframework.orm.ibatis;
18
19 import java.util.List JavaDoc;
20 import java.util.Map JavaDoc;
21
22 import com.ibatis.db.sqlmap.RowHandler;
23
24 import org.springframework.dao.DataAccessException;
25
26 /**
27  * Interface that specifies a basic set of iBATIS SqlMap operations.
28  * Implemented by SqlMapTemplate. Not often used, but a useful option
29  * to enhance testability, as it can easily be mocked or stubbed.
30  *
31  * <p>Provides SqlMapTemplate's convenience methods that mirror MappedStatement's
32  * executeXXX methods. See the MappedStatement javadocs for details on those methods.
33  *
34  * <p>NOTE: The SqlMap/MappedStatement API is the one to use with iBATIS SQL Maps 1.x.
35  * The SqlMapClient/SqlMapSession API is only available with SQL Maps 2.
36  *
37  * @author Juergen Hoeller
38  * @since 05.02.2004
39  * @see SqlMapTemplate
40  * @see com.ibatis.db.sqlmap.MappedStatement
41  */

42 public interface SqlMapOperations {
43
44     Object JavaDoc executeQueryForObject(String JavaDoc statementName, Object JavaDoc parameterObject)
45             throws DataAccessException;
46
47     Object JavaDoc executeQueryForObject(String JavaDoc statementName, Object JavaDoc parameterObject, Object JavaDoc resultObject)
48             throws DataAccessException;
49
50     List JavaDoc executeQueryForList(String JavaDoc statementName, Object JavaDoc parameterObject)
51             throws DataAccessException;
52
53     List JavaDoc executeQueryForList(String JavaDoc statementName, Object JavaDoc parameterObject, int skipResults, int maxResults)
54             throws DataAccessException;
55
56     Map JavaDoc executeQueryForMap(String JavaDoc statementName, Object JavaDoc parameterObject, String JavaDoc keyProperty)
57             throws DataAccessException;
58
59     Map JavaDoc executeQueryForMap(String JavaDoc statementName, Object JavaDoc parameterObject, String JavaDoc keyProperty, String JavaDoc valueProperty)
60             throws DataAccessException;
61
62     void executeQueryWithRowHandler(
63             String JavaDoc statementName, Object JavaDoc parameterObject, RowHandler rowHandler)
64             throws DataAccessException;
65
66     int executeUpdate(String JavaDoc statementName, Object JavaDoc parameterObject)
67             throws DataAccessException;
68
69 }
70
Popular Tags