sf logo

sf.qof
Annotation Type Insert


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Insert

Defines an insert method. Insert methods normally use SQL insert statements.

 @Insert(sql = "insert into person (id, name) values ({%1}, {%2})")
 void insertPerson(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 insert method is int or int[] for collections then the implementation of the method will return the insert count for each SQL insert statement:

 @Insert(sql = "insert into person (id, name) values ({%1}, {%2})")
 int[] insertPersons(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.