Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: $ |
2 | package org.hibernate.annotations; |
||
3 | |||
4 | import static java.lang.annotation.ElementType.FIELD; |
||
5 | import static java.lang.annotation.ElementType.METHOD; |
||
6 | import static java.lang.annotation.ElementType.TYPE; |
||
7 | import java.lang.annotation.Retention; |
||
8 | import static java.lang.annotation.RetentionPolicy.RUNTIME; |
||
9 | import java.lang.annotation.Target; |
||
10 | |||
11 | @Target({FIELD, METHOD, TYPE}) |
||
12 | @Retention(RUNTIME) |
||
13 | |||
14 | /** |
||
15 | * Define the foreign key name |
||
16 | */ |
||
17 | public @interface ForeignKey { |
||
18 | /** |
||
19 | * Name of the foreign key. Used in OneToMany, ManyToOne, and OneToOne |
||
20 | * relationships. Used for the owning side in ManyToMany relationships |
||
21 | */ |
||
22 | String name(); |
||
23 | |||
24 | /** |
||
25 | * Used for the non-owning side of a ManyToMany relationship. Ignored |
||
26 | * in other relationships |
||
27 | */ |
||
28 | String inverseName() default ""; |
||
29 | } |