1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.scripting.thymeleaf.integrationtest.mapper;
17
18 import java.util.List;
19
20 import org.apache.ibatis.annotations.*;
21 import org.mybatis.scripting.thymeleaf.integrationtest.domain.Name;
22
23 public interface NameMapper {
24
25 @Options(useGeneratedKeys = true, keyProperty = "id")
26 @Insert("sql/NameMapper/insert.sql")
27 void insert(Name name);
28
29 @Options(useGeneratedKeys = true, keyProperty = "id")
30 @Insert("sql/NameMapper/insertByBulk.sql")
31 void insertByBulk(List<Name> names);
32
33 @Update("sql/NameMapper/update.sql")
34 void update(Name name);
35
36 @Delete("sql/NameMapper/delete.sql")
37 void delete(Name name);
38
39 @Select("SELECT * FROM names")
40 List<Name> getAllNames();
41
42 @Select("sql/NameMapper/findByIds.sql")
43 List<Name> findByIds(@Param("ids") int... ids);
44
45 @Select("sql/NameMapper/findByFirstNames.sql")
46 List<Name> findByFirstNames(@Param("firstNames") List<String> firstNames);
47
48 @Select("sql/NameMapper/findByFirstNames.sql")
49 Name findByFirstNamesWithNotCollectionType(@Param("firstNames") String firstNames);
50
51 @Select("sql/NameMapper/findByIdsWithoutParamAnnotation.sql")
52 List<Name> findByIdsWithoutParamAnnotation(List<Integer> ids);
53
54 @Select("sql/NameMapper/findById.sql")
55 List<Name> findById(@Param("id") Integer id);
56
57 @Select("sql/NameMapper/findByIdWithoutParamAnnotation.sql")
58 List<Name> findByIdWithoutParamAnnotation(Integer id);
59
60 @Select("sql/NameMapper/findByIdWithNestedParam.sql")
61 List<Name> findByIdWithNestedParam(@Param("p") NameParam param);
62
63 @Select({ "SELECT * FROM names", "/*[# th:insert=\"~{sql/NameMapper/findByIdWhere.sql}\" /]*/" })
64 List<Name> findUsingScript(NameParam nameParam);
65
66 @Select("sql/NameMapper/findById.sql")
67 List<Name> findUsingTemplateFile(NameParam nameParam);
68
69 @Select("sql/NameMapper/findByName.sql")
70 List<Name> findByName(NameParam param);
71
72 @Select("sql/NameMapper/findByIdsWithinParam.sql")
73 List<Name> findByIdsWithinParam(NameParam param);
74
75 }