Package org.apache.ibatis.annotations
Annotation Interface Select
The annotation that specify an SQL for retrieving record(s).
 
How to use:
 public interface UserMapper {
   @Select("SELECT id, name FROM users WHERE id = #{id}")
   User selectById(int id);
 }
 - Author:
- Clinton Begin
- 
Nested Class SummaryNested Classes
- 
Required Element SummaryRequired Elements
- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionbooleanReturns whether this select affects DB data.
 e.g.
- 
Element Details- 
valueString[] valueReturns an SQL for retrieving record(s).- Returns:
- an SQL for retrieving record(s)
 
- 
databaseIdString databaseId- Returns:
- A database id that correspond this statement
- Since:
- 3.5.5
 - Default:
- ""
 
- 
affectDataboolean affectDataReturns whether this select affects DB data.
 e.g. RETURNING of PostgreSQL or OUTPUT of MS SQL Server.- Returns:
- trueif this select affects DB data;- falseif otherwise
- Since:
- 3.5.12
 - Default:
- false
 
 
-