1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.repeatable;
17
18 import org.apache.ibatis.annotations.Select;
19 import org.apache.ibatis.annotations.SelectProvider;
20
21 public interface BothSelectContainerAndSelectProviderContainerMapper {
22
23 @Select(value = "SELECT * FROM users WHERE id = #{id}", databaseId = "hsql")
24 @Select("SELECT * FROM users WHERE id = #{id}")
25 @SelectProvider(type = SqlProvider.class, method = "getUser", databaseId = "hsql")
26 @SelectProvider(type = SqlProvider.class, method = "getUser")
27 User getUser(Integer id);
28
29 class SqlProvider {
30 public static String getUser() {
31 return "SELECT * FROM users WHERE id = #{id}";
32 }
33
34 private SqlProvider() {
35 }
36 }
37
38 }