|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Subclass
Indicates that a class is part of a polymorphic persistence hierarchy. Subclasses of an @Entity should be flagged with this annotation.
This is used for Objectify's implementation of polymorphism. Place this on any class in an inheritance hierarchy that should be queryable except the root. For example, in the hierarchy Animal->Mammal->Cat, annotations should be:
The @Entity annotation must be present on the class that identifies the root of the hierarchy. This class will define the kind of the entire hierarchy. The @Entity annotation must NOT be present on any subclasses.
Actual Java subclasses are not required to have @Subclass, but only Java classes which have @Subclass can be persisted and queried for.
Optional Element Summary | |
---|---|
java.lang.String[] |
alsoLoad
Additional discriminators which, when encountered, will be interpreted as indicating this subclass. |
java.lang.String |
name
Optionally define the discriminator value for the subclass; default is Class.getSimpleName() |
boolean |
unindexed
If true, the discriminator will not be indexed, and a query for the specific subclass will not return results. |
public abstract java.lang.String name
public abstract boolean unindexed
public abstract java.lang.String[] alsoLoad
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |