Skip to content

Commit

Permalink
Merge pull request #3124 from hazendaz/master
Browse files Browse the repository at this point in the history
[ci] formatting
  • Loading branch information
hazendaz committed Apr 1, 2024
2 parents adcdebe + 32d7872 commit 0454158
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions src/main/java/org/apache/ibatis/annotations/Select.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2023 the original author or authors.
* Copyright 2009-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,33 +26,33 @@
* The annotation that specify an SQL for retrieving record(s).
* <p>
* <b>How to use:</b>
* <br/>
* <p>
* <ul>
* <li>
* Simple:
* <pre>
* public interface UserMapper {
* &#064;Select("SELECT id, name FROM users WHERE id = #{id}")
* User selectById(int id);
* }
* </pre>
* </li>
* <li>
* Dynamic SQL:
* <pre>
* public interface UserMapper {
* &#064;Select({"&lt;script>",
* "select * from users",
* "where name = #{name}",
* "&lt;if test=\"age != null\"> age = #{age} &lt;/if>",
* "&lt;/script>"})
* User select(@NotNull String name, @Nullable Intger age);
* }
* </pre>
* </li>
* <li>Simple:
*
* <pre>{@code
* public interface UserMapper {
* @Select("SELECT id, name FROM users WHERE id = #{id}")
* User selectById(int id);
* }
* }</pre>
*
* </li>
* <li>Dynamic SQL:
*
* <pre>{@code
* 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 Intger age);
* }
* }</pre>
*
* </li>
* </ul>
*
* @author Clinton Begin
*
* @see <a href="https://mybatis.org/mybatis-3/dynamic-sql.html">How to use Dynamic SQL</a>
*/
@Documented
Expand All @@ -69,6 +69,7 @@

/**
* @return A database id that correspond this statement
*
* @since 3.5.5
*/
String databaseId() default "";
Expand All @@ -78,6 +79,7 @@
* e.g. RETURNING of PostgreSQL or OUTPUT of MS SQL Server.
*
* @return {@code true} if this select affects DB data; {@code false} if otherwise
*
* @since 3.5.12
*/
boolean affectData() default false;
Expand All @@ -86,6 +88,7 @@
* The container annotation for {@link Select}.
*
* @author Kazuki Shimizu
*
* @since 3.5.5
*/
@Documented
Expand Down

0 comments on commit 0454158

Please sign in to comment.