|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@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);
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 | ||||||||