|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={FIELD,METHOD,TYPE}) @Retention(value=RUNTIME) public @interface AutoGeneratedKeys
The AutoGeneratedKeys
annotation marks classes, or fields in the
data-object that are to be filled in from keys that are generated by an
@Update
query. Fields and methods annotated by this class may
also be annotated by @ResultColumn
for
@Select
methods or to specify the column name for the field.
This annotation can be used in two ways, you can either annotate an entire
class as a "keys" class, as below:
@AutoGeneratedKeys
public class PostKey {
public Long topicId;
public Long postId;
}
Or you can annotate individual methods and fields in a class as "keys" columns.
As with the @Select
annotation, only methods annotated with
@ResultColumn
will be invoked. An example:
public class Post { @AutoGeneratedKeys @ResultColumn("topic_id") public Long topicId; @AutoGeneratedKeys public Long id; public String title; }
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |