Annotation Interface DoNotStore


@Documented @Inherited @Target(TYPE) public @interface DoNotStore

In particular, you should not:

  • Store annotated objects on a field
  • Cache annotated objects in any collection

Doing so may result in memory leaks and/or result in you operating on a stale object, meaning your operations will fail, often silently.

Where objects have identifiers (usually a UUID or name), you should store the identifiers instead, and use these to get the required object from the API when needed.