|
1 | 1 | /*
|
2 |
| - * Copyright 2009-2024 the original author or authors. |
| 2 | + * Copyright 2009-2023 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
25 | 25 | /**
|
26 | 26 | * The annotation that specify an SQL for retrieving record(s).
|
27 | 27 | * <p>
|
28 |
| - * <b>How to use:</b> <br/> |
| 28 | + * <b>How to use:</b> |
| 29 | + * <br/> |
29 | 30 | * <ul>
|
30 |
| - * <li>Simple: |
31 |
| - * |
32 |
| - * <pre> |
33 |
| - * public interface UserMapper { |
34 |
| - * @Select("SELECT id, name FROM users WHERE id = #{id}") |
35 |
| - * User selectById(int id); |
36 |
| - * } |
37 |
| - * </pre> |
38 |
| - * |
39 |
| - * </li> |
40 |
| - * <li>Dynamic SQL: |
41 |
| - * |
42 |
| - * <pre> |
43 |
| - * public interface UserMapper { |
44 |
| - * @Select({ "<script>", "select * from users", "where name = #{name}", |
45 |
| - * "<if test=\"age != null\"> age = #{age} </if>", "</script>" }) |
46 |
| - * User select(@NotNull String name, @Nullable Intger age); |
47 |
| - * } |
48 |
| - * </pre> |
49 |
| - * |
50 |
| - * </li> |
| 31 | + * <li> |
| 32 | + * Simple: |
| 33 | + * <pre> |
| 34 | + * public interface UserMapper { |
| 35 | + * @Select("SELECT id, name FROM users WHERE id = #{id}") |
| 36 | + * User selectById(int id); |
| 37 | + * } |
| 38 | + * </pre> |
| 39 | + * </li> |
| 40 | + * <li> |
| 41 | + * Dynamic SQL: |
| 42 | + * <pre> |
| 43 | + * public interface UserMapper { |
| 44 | + * @Select({"<script>", |
| 45 | + * "select * from users", |
| 46 | + * "where name = #{name}", |
| 47 | + * "<if test=\"age != null\"> age = #{age} </if>", |
| 48 | + * "</script>"}) |
| 49 | + * User select(@NotNull String name, @Nullable Intger age); |
| 50 | + * } |
| 51 | + * </pre> |
| 52 | + * </li> |
51 | 53 | * </ul>
|
52 | 54 | *
|
53 | 55 | * @author Clinton Begin
|
54 |
| - * |
55 | 56 | * @see <a href="https://mybatis.org/mybatis-3/dynamic-sql.html">How to use Dynamic SQL</a>
|
56 | 57 | */
|
57 | 58 | @Documented
|
|
68 | 69 |
|
69 | 70 | /**
|
70 | 71 | * @return A database id that correspond this statement
|
71 |
| - * |
72 | 72 | * @since 3.5.5
|
73 | 73 | */
|
74 | 74 | String databaseId() default "";
|
|
78 | 78 | * e.g. RETURNING of PostgreSQL or OUTPUT of MS SQL Server.
|
79 | 79 | *
|
80 | 80 | * @return {@code true} if this select affects DB data; {@code false} if otherwise
|
81 |
| - * |
82 | 81 | * @since 3.5.12
|
83 | 82 | */
|
84 | 83 | boolean affectData() default false;
|
|
87 | 86 | * The container annotation for {@link Select}.
|
88 | 87 | *
|
89 | 88 | * @author Kazuki Shimizu
|
90 |
| - * |
91 | 89 | * @since 3.5.5
|
92 | 90 | */
|
93 | 91 | @Documented
|
|
0 commit comments