KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibatis > sqlmap > engine > exchange > DataExchange


1 /*
2  * Copyright 2004 Clinton Begin
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 package com.ibatis.sqlmap.engine.exchange;
17
18 import com.ibatis.sqlmap.engine.cache.CacheKey;
19 import com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap;
20 import com.ibatis.sqlmap.engine.mapping.result.ResultMap;
21 import com.ibatis.sqlmap.engine.scope.RequestScope;
22
23 import java.util.Map JavaDoc;
24
25 /**
26  * Interface for exchanging data between a parameter map/result map and the related objects
27  */

28 public interface DataExchange {
29
30   /**
31    * Initializes the data exchange instance.
32    *
33    * @param properties
34    */

35   public void initialize(Map properties);
36
37   /**
38    * Gets a data array from a parameter object.
39    *
40    * @param request - the scope of the request
41    * @param parameterMap - the parameter map
42    * @param parameterObject - the parameter object
43    *
44    * @return - the objects
45    */

46   public Object JavaDoc[] getData(RequestScope request, ParameterMap parameterMap, Object JavaDoc parameterObject);
47
48   /**
49    * Sets values from a data array into a result object.
50    *
51    * @param request - the request scope
52    * @param resultMap - the result map
53    * @param resultObject - the result object
54    * @param values - the values to be mapped
55    *
56    * @return
57    */

58   public Object JavaDoc setData(RequestScope request, ResultMap resultMap, Object JavaDoc resultObject, Object JavaDoc[] values);
59
60
61   /**
62    * Sets values from a data array into a parameter object
63    *
64    * @param request - the request scope
65    * @param parameterMap - the parameter map
66    * @param parameterObject - the parameter object
67    * @param values - the values to set
68    *
69    * @return
70    */

71   public Object JavaDoc setData(RequestScope request, ParameterMap parameterMap, Object JavaDoc parameterObject, Object JavaDoc[] values);
72
73   /**
74    * Returns an object capable of being a unique cache key for a parameter object.
75    *
76    * @param request - the request scope
77    * @param parameterMap - the parameter map
78    * @param parameterObject - the parameter object
79    *
80    * @return - a cache key
81    */

82   public CacheKey getCacheKey(RequestScope request, ParameterMap parameterMap, Object JavaDoc parameterObject);
83
84 }
85
Popular Tags