| 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 non-persistent even when it is not declared with the |
| 20 |
* <code>transient</code> 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 non-transient (persistent) with |
| 28 |
* respect to Java serialization but is transient with respect to the DPL.</p> |
| 29 |
* |
| 30 |
* <pre style="code"> |
| 31 |
* {@code @NotPersistent} |
| 32 |
* int myField; |
| 33 |
* } |
| 34 |
* </pre> |
| 35 |
* |
| 36 |
* @see NotTransient |
| 37 |
* @author Mark Hayes |
| 38 |
*/ |
| 39 |
@Documented @Retention(RUNTIME) @Target(FIELD) |
| 40 |
public @interface NotPersistent { |
| 41 |
} |