Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
//$Id: TableGenerator.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 static java.lang.annotation.ElementType.*;
6
import java.lang.annotation.Retention;
7
import static java.lang.annotation.RetentionPolicy.RUNTIME;
8
import java.lang.annotation.Target;
9
 
10
/**
11
 * This annotation defines a primary key generator that may be referenced by name when a generator
12
 * element is specified for the GeneratedValue annotation. A table generator may be specified on the
13
 * entity class or on the primary key field or property. The scope of the generator name is global to
14
 * the persistence unit (across all generator types).
15
 *
16
 * @author Emmanuel Bernard
17
 */
18
@Target({TYPE, METHOD, FIELD})
19
@Retention(RUNTIME)
20
public @interface TableGenerator {
21
        /**
22
         * A unique generator name that can be referenced by one or more classes to be the generator for id values
23
         */
24
        String name();
25
        /**
26
         * Name of table that stores the generated id values. Defaults to a name chosen by persistence provider.
27
         */
28
        String table() default "";
29
        /**
30
         * The catalog of the table
31
         * Defaults to the default catalog
32
         */
33
        String catalog() default "";
34
        /**
35
         * The schema of the table
36
         * Defaults to the default schema for user
37
         */
38
        String schema() default "";
39
        /**
40
         * Name of the primary key column in the table
41
         * Defaults to a provider-chosen name
42
         */
43
        String pkColumnName() default "";
44
        /**
45
         * Name of the column that stores the last value generated
46
         * Defaults to a provider-chosen name
47
         */
48
        String valueColumnName() default "";
49
        /**
50
         * The primary key value in the generator table that distinguishes this set of generated values from others that may be stored in the table
51
         * Defaults to a provider-chosen value to store in the primary key column of the generator table
52
         */
53
        String pkColumnValue() default "";
54
        /**
55
         * The initial value to be used when allocating id numbers from the generator
56
         */
57
        int initialValue() default 0;
58
        /**
59
         * The amount to increment by when allocating id numbers from the generator
60
         */
61
        int allocationSize() default 50;
62
        /**
63
         * Unique constraints that are to be placed on the table. These are only used if table generation is in effect. These constraints apply in addition to primary key constraints
64
         * Defaults to no additional constraints
65
         */
66
        UniqueConstraint[] uniqueConstraints() default {};
67
}