1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.sptests;
17
18 import java.util.List;
19 import java.util.Map;
20
21 import org.apache.ibatis.annotations.Options;
22 import org.apache.ibatis.annotations.Param;
23 import org.apache.ibatis.annotations.Result;
24 import org.apache.ibatis.annotations.ResultMap;
25 import org.apache.ibatis.annotations.Results;
26 import org.apache.ibatis.annotations.Select;
27 import org.apache.ibatis.annotations.Update;
28 import org.apache.ibatis.mapping.StatementType;
29
30 public interface SPMapper {
31
32 Object adderAsSelect(Parameter parameter);
33
34 void adderAsUpdate(Parameter parameter);
35
36 void adderWithParameterMap(Map<String, Object> parameter);
37
38 Name getName(Integer id);
39
40 List<Name> getNames(Map<String, Object> parms);
41
42 List<Name> getNamesWithArray(Map<String, Object> parms);
43
44 List<List<?>> getNamesAndItems();
45
46 List<Name> getNamesAndItemsLinked();
47
48 List<Name> getNamesAndItemsLinkedById(int id);
49
50 Object echoDate(Map<String, Object> parameter);
51
52
53 @Select({ "{call sptest.adder(", "#{addend1,jdbcType=INTEGER,mode=IN},", "#{addend2,jdbcType=INTEGER,mode=IN},", "#{sum,jdbcType=INTEGER,mode=OUT})}" })
54 @Options(statementType = StatementType.CALLABLE)
55 Object adderAsSelectAnnotated(Parameter parameter);
56
57 @Update({ "{call sptest.adder(", "#{addend1,jdbcType=INTEGER,mode=IN},", "#{addend2,jdbcType=INTEGER,mode=IN},", "#{sum,jdbcType=INTEGER,mode=OUT})}" })
58 @Options(statementType = StatementType.CALLABLE)
59 void adderAsUpdateAnnotated(Parameter parameter);
60
61 @Select("{call sptest.getname(#{id,jdbcType=INTEGER,mode=IN})}")
62 @Results({ @Result(column = "ID", property = "id"), @Result(column = "FIRST_NAME", property = "firstName"), @Result(column = "LAST_NAME", property = "lastName") })
63 @Options(statementType = StatementType.CALLABLE)
64 Name getNameAnnotated(Integer id);
65
66 @Select("{call sptest.getname(#{id,jdbcType=INTEGER,mode=IN})}")
67 @ResultMap("nameResult")
68 @Options(statementType = StatementType.CALLABLE)
69 Name getNameAnnotatedWithXMLResultMap(Integer id);
70
71 @Select({ "{call sptest.getnames(", "#{lowestId,jdbcType=INTEGER,mode=IN},", "#{totalRows,jdbcType=INTEGER,mode=OUT})}" })
72 @Results({ @Result(column = "ID", property = "id"), @Result(column = "FIRST_NAME", property = "firstName"), @Result(column = "LAST_NAME", property = "lastName") })
73 @Options(statementType = StatementType.CALLABLE)
74 List<Name> getNamesAnnotated(Map<String, Object> parms);
75
76 @Select({ "{call sptest.getnames(", "#{lowestId,jdbcType=INTEGER,mode=IN},", "#{totalRows,jdbcType=INTEGER,mode=OUT})}" })
77 @ResultMap("nameResult")
78 @Options(statementType = StatementType.CALLABLE)
79 List<Name> getNamesAnnotatedWithXMLResultMap(Map<String, Object> parms);
80
81 @Select({ "{call sptest.getnamesLowHigh(", "#{lowestId,jdbcType=INTEGER,mode=IN},", "#{highestId,jdbcType=INTEGER,mode=IN})}" })
82 @ResultMap("nameResult")
83 @Options(statementType = StatementType.CALLABLE)
84 List<Name> getNamesAnnotatedLowHighWithXMLResultMap(@Param("lowestId") int lowestId, @Param("highestId") int highestId);
85
86 @Select({ "{call sptest.arraytest(", "#{ids,mode=IN,jdbcType=ARRAY},", "#{requestedRows,jdbcType=INTEGER,mode=OUT},", "#{returnedIds,mode=OUT,jdbcType=ARRAY})}" })
87 @Results({ @Result(column = "ID", property = "id"), @Result(column = "FIRST_NAME", property = "firstName"), @Result(column = "LAST_NAME", property = "lastName") })
88 @Options(statementType = StatementType.CALLABLE)
89 List<Name> getNamesWithArrayAnnotated(Map<String, Object> parms);
90
91 @Select({ "{call sptest.arraytest(", "#{ids,mode=IN,jdbcType=ARRAY},", "#{requestedRows,jdbcType=INTEGER,mode=OUT},", "#{returnedIds,mode=OUT,jdbcType=ARRAY})}" })
92 @ResultMap("nameResult")
93 @Options(statementType = StatementType.CALLABLE)
94 List<Name> getNamesWithArrayAnnotatedWithXMLResultMap(Map<String, Object> parms);
95
96 @Select("{call sptest.getnamesanditems()}")
97 @ResultMap("nameResult,itemResult")
98 @Options(statementType = StatementType.CALLABLE)
99 List<List<?>> getNamesAndItemsAnnotatedWithXMLResultMap();
100
101 @Select("{call sptest.getnamesanditems()}")
102 @ResultMap({ "nameResult", "itemResult" })
103 @Options(statementType = StatementType.CALLABLE)
104 List<List<?>> getNamesAndItemsAnnotatedWithXMLResultMapArray();
105
106 List<Book> getBookAndGenre();
107 }