1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package javax.jdo.annotations;
18
19 import java.lang.annotation.ElementType;
20 import java.lang.annotation.Retention;
21 import java.lang.annotation.RetentionPolicy;
22 import java.lang.annotation.Target;
23
24 /**
25 * Annotation for a column in the database.
26 * Corresponds to the xml element "column".
27 *
28 * @version 2.1
29 * @since 2.1
30 */
31 @Target({ElementType.FIELD, ElementType.METHOD})
32 @Retention(RetentionPolicy.RUNTIME)
33 public @interface Column
34 {
35 /**
36 * Name of the column.
37 * @return the name of the column
38 */
39 String name() default "";
40
41 /**
42 * Target column for this column in the other table when part of a
43 * foreign key relation.
44 * @return the target column in the other table for this column
45 * when part of a foreign key relation.
46 */
47 String target() default "";
48
49 /**
50 * Target member in the other class or interface for this column
51 * when part of a bidirectional relation.
52 * @return the target member for this column when part of
53 * a bidirectional relation.
54 */
55 String targetMember() default "";
56
57 /**
58 * JDBC Type for this column.
59 * @return JDBC type for this column
60 */
61 String jdbcType() default "";
62
63 /**
64 * SQL Type for this column.
65 * @return SQL type for this column
66 */
67 String sqlType() default "";
68
69 /**
70 * Maximum length of data stored in this column.
71 * @return the maximum length of data stored in this column
72 */
73 int length() default -1;
74
75 /**
76 * Scale for the column when handling floating point values.
77 * @return the scale for the column when handling floating point values
78 */
79 int scale() default -1;
80
81 /**
82 * Whether the column allows null values to be inserted.
83 * @return whether the column allows null values to be inserted
84 */
85 String allowsNull() default "";
86
87 /**
88 * Default value for this column.
89 * @return the default value for this column
90 */
91 String defaultValue() default "";
92
93 /**
94 * Value to be inserted when this is an "unmapped" column
95 * @return the value to be inserted when this is an "unmapped" column
96 */
97 String insertValue() default "";
98
99 /** Vendor extensions.
100 * @return the vendor extensions
101 */
102 Extension[] extensions() default {};
103 }