Debian Codegraph @

lang/java/src/com/sleepycat/persist/model/NotTransient.java

raw
1 /*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2002, 2013 Oracle and/or its affiliates. All rights reserved.
5 *
6 */
7
8 package com.sleepycat.persist.model;
9
10 import static java.lang.annotation.ElementType.FIELD;
11 import static java.lang.annotation.RetentionPolicy.RUNTIME;
12
13 import java.lang.annotation.Documented;
14 import java.lang.annotation.Retention;
15 import java.lang.annotation.Target;
16
17 /**
18 * Overrides the default rules for field persistence and defines a field as
19 * being persistent even when it is declared with the <code>transient</code>
20 * keyword.
21 *
22 * <p>By default, the persistent fields of a class are all declared instance
23 * fields that are non-transient (are not declared with the
24 * <code>transient</code> keyword). The default rules may be overridden by
25 * specifying the {@link NotPersistent} or {@link NotTransient} annotation.</p>
26 *
27 * <p>For example, the following field is transient with respect to Java
28 * serialization but is persistent with respect to the DPL.</p>
29 *
30 * <pre style="code">
31 * {@code @NotTransient}
32 * transient int myField;
33 * }
34 * </pre>
35 *
36 * @see NotPersistent
37 * @author Mark Hayes
38 */
39 @Documented @Retention(RUNTIME) @Target(FIELD)
40 public @interface NotTransient {
41 }