View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
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 the value of a map relation.
26   * Corresponds to the xml element "value".
27   * 
28   * @version 2.1
29   * @since 2.1
30   */
31  @Target({ElementType.FIELD, ElementType.METHOD}) 
32  @Retention(RetentionPolicy.RUNTIME)
33  public @interface Value
34  {
35      /**
36       * Types of the values. This can be determined if using JDK1.5 generics
37       * but is required otherwise. Multiple types can be specified if the
38       * implementation supports multiple types.
39       * @return the types of values
40       */
41      Class[] types() default {};
42  
43      /**
44       * Whether the value  is to be stored serialized (into a single column of a
45       * join table).
46       * @return Whether the value is to be stored serialized (into a join table)
47       */
48      String serialized() default "";
49  
50      /** Whether this value is embedded. 
51       * @return whether this value is embedded
52       */
53      String embedded() default "";
54  
55      /**
56       * The embedded mapping for the value.
57       * @return the embedded mapping for the value
58       */
59      Embedded[] embeddedMapping() default {};
60  
61      /**
62       * Whether the value is dependent on the owner (and will be deleted 
63       * when the owner is deleted).
64       * @return whether the value is dependent on the owner
65       */
66      String dependent() default "";
67  
68      /**
69       * Name of the table for the value.
70       * @return the name of the table for the value
71       */
72      String table() default "";
73  
74      /**
75       * Name of the column to store the value in.
76       * @return the name of the column to store the value in
77       */
78      String column() default "";
79  
80      /**
81       * Delete action to apply to any foreign key for the value.
82       * @return delete action to apply to any foreign key for the value
83       */
84      ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED;
85  
86      /**
87       * Update action to apply to any foreign key for the value.
88       * @return update action to apply to any foreign key for the value
89       */
90      ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED;
91  
92      /**
93       * Whether the value column(s) should be indexed.
94       * @return whether the value column(s) should be indexed.
95       */
96      String indexed() default "";
97  
98      /** The name of the index to generate. 
99       * @return the name of the index
100      */
101     String index() default "";
102 
103     /**
104      * Whether the element column(s) contents should be considered unique
105      * @return whether the element column(s) contents should be considered unique
106      */
107     String unique() default "";
108 
109     /**
110      * The name of the unique key constraint to generate.
111      * @return the name of the unique key constraint
112      */
113     String uniqueKey() default "";
114 
115     /**
116      * Name of a member in the key class where this value is stored.
117      * @return the name of a member in the key class where this value is stored
118      */
119     String mappedBy() default "";
120 
121     /**
122      * The column(s) for the value.
123      * @return the column(s) for the value
124      */
125     Column[] columns() default {};
126 
127     /** Generate or assume a foreign key constraint exists on the column
128      * or columns associated with this join. Specify "true" or "false".
129      * @return whether to generate or assume a foreign key constraint
130      */
131     String generateForeignKey() default "";
132 
133     /** Name for a generated foreign key constraint.
134      * @return the name of the generated foreign key constraint
135      */
136     String foreignKey() default "";
137 
138     /** Vendor extensions.
139      * @return the vendor extensions
140      */
141     Extension[] extensions() default {};
142 }