Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: GeneratedValue.java 11282 2007-03-14 22:05:59Z epbernard $ |
2 | package javax.persistence; |
||
3 | |||
4 | import static java.lang.annotation.ElementType.FIELD; |
||
5 | import static java.lang.annotation.ElementType.METHOD; |
||
6 | import java.lang.annotation.Retention; |
||
7 | import static java.lang.annotation.RetentionPolicy.RUNTIME; |
||
8 | import java.lang.annotation.Target; |
||
9 | |||
10 | /** |
||
11 | * Provides for the specification of generation strategies for the values of primary keys. |
||
12 | * The GeneratedValue annotation may be applied to a primary key property or field of an entity |
||
13 | * or mapped superclass in conjunction with the Id annotation. |
||
14 | * |
||
15 | * @author Emmanuel Bernard |
||
16 | */ |
||
17 | @Target({METHOD, FIELD}) |
||
18 | @Retention(RUNTIME) |
||
19 | public @interface GeneratedValue { |
||
20 | /** |
||
21 | * The primary key generation strategy that the persistence provider must use |
||
22 | * to generate the annotated entity primary key. |
||
23 | */ |
||
24 | GenerationType strategy() default GenerationType.AUTO; |
||
25 | /** |
||
26 | * The name of the primary key generator to use as specified in the SequenceGenerator or |
||
27 | * TableGenerator annotation. |
||
28 | * |
||
29 | * Defaults to the id generator supplied by persistence provider. |
||
30 | */ |
||
31 | String generator() default ""; |
||
32 | } |