@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Derived
Storable
property which is not directly persisted, but
is instead derived from other property values. A derived property cannot be
abstract, and a "set" method is optional.
Derived properties can be used just like a normal property in most
cases. They can be used in query filters, indexes, alternate keys, and they
can also be used to define a Version
property.
If the derived property depends on Join
properties and is also
used in an index or alternate key, dependencies must be listed in order for
the index to be properly updated.
Example:
@Indexes(@Index("uppercaseName")) public abstract class UserInfo implements Storable<UserInfo> { /** * Derive an uppercase name for case-insensitive searches. */ @Derived public String getUppercaseName() { String name = getName(); return name == null ? null : name.toUpperCase(); } ... }
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String[] |
from
List of properties that this property is derived from.
|
boolean |
shouldCopy
Returns whether this property should be included when copying a
storable.
|
public abstract java.lang.String[] from
public abstract boolean shouldCopy
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.