Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: SequenceGenerator.java 11282 2007-03-14 22:05:59Z epbernard $ |
2 | //EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc. |
||
3 | package javax.persistence; |
||
4 | |||
5 | import java.lang.annotation.Retention; |
||
6 | import java.lang.annotation.Target; |
||
7 | |||
8 | import static java.lang.annotation.ElementType.*; |
||
9 | import static java.lang.annotation.RetentionPolicy.*; |
||
10 | |||
11 | /** |
||
12 | * This annotation defines a primary key generator that may be referenced by name when a generator |
||
13 | * element is specified for the GeneratedValue annotation. A sequence generator may be specified on |
||
14 | * the entity class or on the primary key field or property. The scope of the generator name is global |
||
15 | * to the persistence unit (across all generator types). |
||
16 | * |
||
17 | * @author Emmanuel Bernard |
||
18 | */ |
||
19 | @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) |
||
20 | public @interface SequenceGenerator { |
||
21 | /** |
||
22 | * A unique generator name that can be referenced by one or more classes to be the generator for primary key values |
||
23 | */ |
||
24 | String name(); |
||
25 | /** |
||
26 | * The name of the database sequence object from which to obtain primary key values |
||
27 | * Defaults to a provider-chosen value |
||
28 | */ |
||
29 | String sequenceName() default ""; |
||
30 | /** |
||
31 | * The value from which the sequence object is to start generating |
||
32 | */ |
||
33 | int initialValue() default 1; |
||
34 | /** |
||
35 | * The amount to increment by when allocating sequence numbers from the sequence |
||
36 | */ |
||
37 | int allocationSize() default 50; |
||
38 | } |