|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME)
public @interface GeneratedKey
When used to annotate a property of a pureQuery bean, directs pureQuery to set the value of the property to the value of the corresponding database column after an SQL INSERT statement runs.
In pureQuery method style, pureQuery updates the properties of a pureQuery bean that have the @GeneratedKey
annotation when the pureQuery bean is a parameter to an annotated method that has the @Update
annotation and that runs an SQL INSERT statement. The pureQuery bean must be the only parameter to the method.
When the pureQuery inline-style method Data.update(String sql, Object... parameters)
is invoked to run an SQL INSERT statement, if the first parameter of the Object... parameters
is a pureQuery bean, pureQuery updates the properties of the bean that have the @GeneratedKey
annotation.
When the pureQuery inline-style method Data.update(String sql, Class returnClass, String[] columnNames, Object... parameters)
is invoked, pureQuery does not update the properties of pureQuery beans. Instead, pureQuery returns an object that describes the contents of the requested database columns. If the parameter String[] columnNames
is null
, and the first parameter of the Object... parameters
is a pureQuery bean, pureQuery uses the @GeneratedKey
annotations in the pureQuery bean to determine which columns to return.
Attention: No more than one parameter for each update method can be a pureQuery bean that contains the @GeneratedKey
annotation.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |