diff --git a/src/main/java/org/apache/ibatis/annotations/CacheNamespace.java b/src/main/java/org/apache/ibatis/annotations/CacheNamespace.java index 03c136442ee..1fa24028e40 100644 --- a/src/main/java/org/apache/ibatis/annotations/CacheNamespace.java +++ b/src/main/java/org/apache/ibatis/annotations/CacheNamespace.java @@ -30,14 +30,16 @@ *
* How to use: * - *
{@code - * @CacheNamespace(implementation = CustomCache.class, properties = { - * @Property(name = "host", value = "${mybatis.cache.host}"), - * @Property(name = "port", value = "${mybatis.cache.port}"), @Property(name = "name", value = "usersCache") }) + ** * @author Clinton Begin * @author Kazuki Shimizu diff --git a/src/main/java/org/apache/ibatis/annotations/ConstructorArgs.java b/src/main/java/org/apache/ibatis/annotations/ConstructorArgs.java index 73c6d45459d..b74aa654a66 100644 --- a/src/main/java/org/apache/ibatis/annotations/ConstructorArgs.java +++ b/src/main/java/org/apache/ibatis/annotations/ConstructorArgs.java @@ -26,15 +26,16 @@ *+ *+ * + *@CacheNamespace(implementation = CustomCache.class, properties = { + * @Property(name = "host", value = "${mybatis.cache.host}"), + * @Property(name = "port", value = "${mybatis.cache.port}"), + * @Property(name = "name", value = "usersCache") }) * public interface UserMapper { * // ... * } - * }
* How to use: * - *
{@code - * public interface UserMapper { - * @ConstructorArgs({ @Arg(column = "id", javaType = int.class, id = true), - * @Arg(column = "name", javaType = String.class), - * @Arg(javaType = UserEmail.class, select = "selectUserEmailById", column = "id") }) + ** * @author Clinton Begin */ diff --git a/src/main/java/org/apache/ibatis/annotations/Select.java b/src/main/java/org/apache/ibatis/annotations/Select.java index f105580a3e4..a1e07968ce4 100644 --- a/src/main/java/org/apache/ibatis/annotations/Select.java +++ b/src/main/java/org/apache/ibatis/annotations/Select.java @@ -29,23 +29,25 @@ *+ *+ * + *public interface UserMapper { + * @ConstructorArgs({ @Arg(column = "id", javaType = int.class, id = true), + * @Arg(column = "name", javaType = String.class), + * @Arg(javaType = UserEmail.class, select = "selectUserEmailById", column = "id") }) * @Select("SELECT id, name FROM users WHERE id = #{id}") * User selectById(int id); * } - * }
{@code - * public interface UserMapper { - * @Select("SELECT id, name FROM users WHERE id = #{id}") + ** *+ *+ * + *public interface UserMapper { + * @Select("SELECT id, name FROM users WHERE id = #{id}") * User selectById(int id); * } - * }
{@code - * public interface UserMapper { - * @Select({ "" }) + ** *+ *+ * + *public interface UserMapper { + * @Select({ "<script>", "select * from users", "where name = #{name}", + * "<if test=\"age != null\"> age = #{age} </if>", "</script>" }) * User select(@NotNull String name, @Nullable Integer age); * } - * }
* How to use: * - *
{@code - * public interface UserMapper { + ** * @author Clinton Begin */ diff --git a/src/main/java/org/apache/ibatis/plugin/Intercepts.java b/src/main/java/org/apache/ibatis/plugin/Intercepts.java index 916786d75ee..150900c8ed6 100644 --- a/src/main/java/org/apache/ibatis/plugin/Intercepts.java +++ b/src/main/java/org/apache/ibatis/plugin/Intercepts.java @@ -26,8 +26,8 @@ *+ *+ * + *public interface UserMapper { * @Select("SELECT id, name, type FROM users ORDER BY id") * @TypeDiscriminator(column = "type", javaType = String.class, cases = { - * @Case(value = "1", type = PremiumUser.class), @Case(value = "2", type = GeneralUser.class), - * @Case(value = "3", type = TemporaryUser.class) }) + * @Case(value = "1", type = PremiumUser.class), + * @Case(value = "2", type = GeneralUser.class), + * @Case(value = "3", type = TemporaryUser.class) }) * List<User> selectAll(); * } - * }
* How to use: * - *
{@code - * @Intercepts({ @Signature(type = Executor.class, method = "update", args = { MappedStatement.class, Object.class }) }) + ** * @author Clinton Begin */+ *+ * + *@Intercepts({ @Signature(type = Executor.class, method = "update", args = { MappedStatement.class, Object.class }) }) * public class ExamplePlugin implements Interceptor { * @Override * public Object intercept(Invocation invocation) throws Throwable { @@ -37,7 +37,8 @@ * return returnObject; * } * } - * }