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 whether the class or interface is persistence-capable.
26   * 
27   * @version 2.1
28   * @since 2.1
29   */
30  @Target(ElementType.TYPE) 
31  @Retention(RetentionPolicy.RUNTIME)
32  public @interface PersistenceCapable
33  {
34      /** Member declarations. Annotations for persistent members of this
35       * class or interface can be specifed either here or on each member.
36       * Annotations for inherited members can only be specified here.
37       * @return member declarations
38       */
39      Persistent[] members() default {};
40  
41      /** Table to use for persisting this class or interface. 
42       */
43      String table() default "";
44  
45      /** Catalog to use for persisting this class or interface. 
46       */
47      String catalog() default "";
48  
49      /** Schema to use for persisting this class or interface. 
50       */
51      String schema() default "";
52  
53      /** Whether this class or interface manages an extent. 
54       */
55      String requiresExtent() default "";
56  
57      /** Whether objects of this class or interface can only be embedded. 
58       */
59      String embeddedOnly() default "";
60  
61      /** Whether this class or interface is detachable. 
62       */
63      String detachable() default "";
64  
65      /** Type of identity for this class or interface. 
66       */
67      IdentityType identityType() default IdentityType.UNSPECIFIED;
68  
69      /** Primary key class when using application identity and using own PK. 
70       */
71      Class objectIdClass() default void.class;
72  
73      /** Whether this class is cacheable in a Level2 cache.
74       * @since 2.2
75       */
76      String cacheable() default "true";
77  
78      /** Whether objects of this type should, by default, be locked when read.
79       * @since 3.0
80       */
81      String serializeRead() default "false";
82  
83      /** Any vendor extensions.
84       */
85      Extension[] extensions() default {};
86  }