Class Entities
java.lang.Object
com.google.appengine.api.datastore.Entities
Utility functions and constants for entities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longID for __entity_group__ entities.static final StringA metadata kind that can be used to get information about entity groups.static final StringA metadata kind that can be used to query for kinds that exist in the datastore.static final longThe numeric ID for __namespace__ keys representing the empty namespace.static final StringA metadata kind that can be used to query for namespaces that exist in the datastore.static final StringA metadata kind that can be used to query for properties that exist in the datastore. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeycreateEntityGroupKey(Key key) Create an __entity_group__ key for the entity group containingkey.static KeycreateKindKey(String kind) Create a __kind__ key forkind.static KeycreateNamespaceKey(String namespace) Create a __namespace__ key fornamespace.static KeycreatePropertyKey(String kind, String property) Create a __property__ key forpropertyofkind.static @Nullable StringgetNamespaceFromNamespaceKey(Key namespaceKey) Extract the namespace name from a __namespace__ key.static longgetVersionProperty(Entity entity) Get the value of the __version__ property fromentity.
-
Field Details
-
KIND_METADATA_KIND
A metadata kind that can be used to query for kinds that exist in the datastore.- See Also:
-
PROPERTY_METADATA_KIND
A metadata kind that can be used to query for properties that exist in the datastore.- See Also:
-
NAMESPACE_METADATA_KIND
A metadata kind that can be used to query for namespaces that exist in the datastore.- See Also:
-
NAMESPACE_METADATA_EMPTY_ID
public static final long NAMESPACE_METADATA_EMPTY_IDThe numeric ID for __namespace__ keys representing the empty namespace.- See Also:
-
ENTITY_GROUP_METADATA_KIND
A metadata kind that can be used to get information about entity groups. The metadata for the entity group with root entity key R is fetched using aDatastoreService.get(com.google.appengine.api.datastore.Key)call on keyKeyFactory.createKey(R, ENTITY_GROUP_METADATA_KIND, ENTITY_GROUP_METADATA_ID).The resulting entity has a
Entity.VERSION_RESERVED_PROPERTYnumeric property whose value is guaranteed to increase on every change to the entity group. This value may also occasionally increase without any user-visible change to the entity group.- See Also:
-
ENTITY_GROUP_METADATA_ID
public static final long ENTITY_GROUP_METADATA_IDID for __entity_group__ entities.- See Also:
-
-
Constructor Details
-
Entities
public Entities()
-
-
Method Details
-
createKindKey
Create a __kind__ key forkind.- Parameters:
kind- Kind to create key for.- Returns:
- __kind__ key.
-
createPropertyKey
Create a __property__ key forpropertyofkind.- Parameters:
kind- Kind to create key for.property- Property to create key for.- Returns:
- __property__ key.
-
createNamespaceKey
Create a __namespace__ key fornamespace.- Parameters:
namespace- Namespace to create key for.- Returns:
- __namespace__ key.
-
getNamespaceFromNamespaceKey
Extract the namespace name from a __namespace__ key.- Parameters:
namespaceKey- Key to extract namespace from.- Returns:
- The namespace name.
-
createEntityGroupKey
Create an __entity_group__ key for the entity group containingkey.- Parameters:
key- Key of any entity in the entity group.- Returns:
- __entity_group__ key.
-
getVersionProperty
Get the value of the __version__ property fromentity.- Parameters:
entity- Entity to fetch __version__ from (must have a numeric __version__ property).- Returns:
- __version__ property value.
-