sf logo

sf.qof
Annotation Type Update


@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);
 

See Also:
SqlParser

Required Element Summary
 String sql
          This is the SQL statement.
 

Element Detail

sql

public abstract String sql
This is the SQL statement.

Returns:
SQL statement
See Also:
SqlParser

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.