Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: SecondaryTable.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 is used to specify a secondary table for the annotated entity class. Specifying |
||
13 | * one or more secondary tables indicates that the data for the entity class is stored across multiple |
||
14 | * tables. |
||
15 | * |
||
16 | * If no SecondaryTable annotation is specified, it is assumed that all persistent fields or properties |
||
17 | * of the entity are mapped to the primary table. If no primary key join columns are specified, the |
||
18 | * join columns are assumed to reference the primary key columns of the primary table, and have the |
||
19 | * same names and types as the referenced primary key columns of the primary table. |
||
20 | * |
||
21 | * @author Emmanuel Bernard |
||
22 | */ |
||
23 | @Target({TYPE}) @Retention(RUNTIME) |
||
24 | public @interface SecondaryTable { |
||
25 | /** |
||
26 | * The name of the table |
||
27 | */ |
||
28 | String name(); |
||
29 | /** |
||
30 | * The catalog of the table |
||
31 | */ |
||
32 | String catalog() default ""; |
||
33 | /** |
||
34 | * The schema of the table |
||
35 | */ |
||
36 | String schema() default ""; |
||
37 | /** |
||
38 | * The columns that are used to join with the primary table. |
||
39 | * |
||
40 | * Defaults to the column(s) of the same name(s) as the primary key column(s) |
||
41 | * in the primary table |
||
42 | */ |
||
43 | PrimaryKeyJoinColumn[] pkJoinColumns() default {}; |
||
44 | /** |
||
45 | * Unique constraints that are to be placed on the table. These are typically only used if |
||
46 | * table generation is in effect. These constraints apply in addition to any constraints |
||
47 | * specified by the Column and JoinColumn annotations and constraints entailed by primary |
||
48 | * key mappings. |
||
49 | * |
||
50 | * Defaults to no additional constraints. |
||
51 | */ |
||
52 | UniqueConstraint[] uniqueConstraints() default {}; |
||
53 | } |