|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Retention(value=RUNTIME) @Target(value=METHOD) public @interface Update
Defines an update method. Update methods normally use SQL update statements.
@Update(sql = "update person set name = {%2} where id = {%1}")
int updatePersonName(int id, String name);
{%1} defines a parameter mapping to the primitive type parameter id
{%2} defines a parameter mapping to the String type parameter name
If the return parameter of the update method is int or int[] for collections
then the implementation of the method will return the update count for each SQL update statement.
@Update(sql = "update person set name = {%2} where id = {%1}")
int[] updatePersonNames(List<Integer> idList, List<String> nameList);
SqlParser| Required Element Summary | |
|---|---|
String |
sql
This is the SQL statement. |
| Element Detail |
|---|
public abstract String sql
SqlParser
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||