Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
//$Id: Table.java 11282 2007-03-14 22:05:59Z epbernard $
2
package org.hibernate.annotations;
3
 
4
import static java.lang.annotation.ElementType.TYPE;
5
import java.lang.annotation.Retention;
6
import static java.lang.annotation.RetentionPolicy.RUNTIME;
7
import java.lang.annotation.Target;
8
 
9
/**
10
 * Complementary information to a table either primary or secondary
11
 *
12
 * @author Emmanuel Bernard
13
 */
14
@Target({TYPE})
15
@Retention(RUNTIME)
16
public @interface Table {
17
        /**
18
         * name of the targeted table
19
         */
20
        String appliesTo();
21
 
22
        /**
23
         * Indexes
24
         */
25
        Index[] indexes() default {};
26
 
27
        /**
28
         * define a table comment
29
         */
30
        String comment() default "";
31
 
32
        /**
33
         * Defines the Foreign Key name of a secondary table
34
         * pointing back to the primary table
35
         */
36
        ForeignKey foreignKey() default @ForeignKey( name="" );
37
 
38
        /**
39
         * If set to JOIN, the default, Hibernate will use an inner join to retrieve a
40
         * secondary table defined by a class or its superclasses and an outer join for a
41
         * secondary table defined by a subclass.
42
         * If set to select then Hibernate will use a
43
         * sequential select for a secondary table defined on a subclass, which will be issued only if a row
44
         * turns out to represent an instance of the subclass. Inner joins will still be used to retrieve a
45
         * secondary defined by the class and its superclasses.
46
         *
47
         * <b>Only applies to secondary tables</b>
48
         */
49
        FetchMode fetch() default FetchMode.JOIN;
50
 
51
        /**
52
         * If true, Hibernate will not try to insert or update the properties defined by this join.
53
         *
54
         * <b>Only applies to secondary tables</b>
55
         */
56
        boolean inverse() default false;
57
 
58
        /**
59
         * If enabled, Hibernate will insert a row only if the properties defined by this join are non-null
60
         * and will always use an outer join to retrieve the properties.
61
         *
62
         * <b>Only applies to secondary tables</b>
63
         */
64
        boolean optional() default true;
65
 
66
        /**
67
         * Defines a custom SQL insert statement
68
         *
69
         * <b>Only applies to secondary tables</b>
70
         */
71
        SQLInsert sqlInsert() default @SQLInsert(sql="");
72
 
73
        /**
74
         * Defines a custom SQL update statement
75
         *
76
         * <b>Only applies to secondary tables</b>
77
         */
78
        SQLUpdate sqlUpdate() default @SQLUpdate(sql="");
79
 
80
        /**
81
         * Defines a custom SQL delete statement
82
         *
83
         * <b>Only applies to secondary tables</b>
84
         */
85
        SQLDelete sqlDelete() default @SQLDelete(sql="");
86
}