public class DatastoreUtils extends Object
Constructor and Description |
---|
DatastoreUtils() |
Modifier and Type | Method and Description |
---|---|
static com.google.appengine.api.datastore.Query |
cloneQuery(com.google.appengine.api.datastore.Query orig)
Make a new Query object that is exactly like the old.
|
static <T> Key<T> |
createKey(Key<?> parent,
Class<T> kind,
Object id)
Construct a Key> from a Long or String id
|
static <T> Key<T> |
createKey(Key<?> parent,
String kind,
Object id)
Construct a Key> from a Long or String id
|
static com.google.appengine.api.datastore.Key |
createKey(com.google.appengine.api.datastore.Key parent,
String kind,
Object id)
Construct a Key from a Long or String id
|
static <T> List<Key<T>> |
createKeys(Key<?> parent,
Class<T> kind,
Iterable<?> ids)
Make a list of Key>s
|
static List<com.google.appengine.api.datastore.Key> |
createKeys(com.google.appengine.api.datastore.Key parent,
String kind,
Iterable<?> ids)
Make a list of keys
|
static <S> S |
getId(com.google.appengine.api.datastore.Key key)
Gets the String or Long id from the key, or null if incomplete
|
static <S> S |
getId(Key<?> key)
Gets the String or Long id from the key, or null if incomplete
|
static com.google.appengine.api.datastore.Key |
getKey(com.google.appengine.api.datastore.PropertyContainer container)
Unfortunately Entity and EmbeddedEntity do not share a common interface for getting key.
|
static List<com.google.appengine.api.datastore.Key> |
getRawKeys(Iterable<? extends Ref<?>> refs)
Turn a list of refs into a list of raw keys.
|
static void |
setContainerProperty(com.google.appengine.api.datastore.PropertyContainer entity,
String propertyName,
Object value,
boolean index,
SaveContext ctx,
Path propPath)
Calls setProperty() or setUnindexedProperty() as determined by the index parameter.
|
public static List<com.google.appengine.api.datastore.Key> getRawKeys(Iterable<? extends Ref<?>> refs)
public static com.google.appengine.api.datastore.Query cloneQuery(com.google.appengine.api.datastore.Query orig)
public static <T> Key<T> createKey(Key<?> parent, Class<T> kind, Object id)
id
- must be either Long or Stringpublic static <T> Key<T> createKey(Key<?> parent, String kind, Object id)
id
- must be either Long or Stringpublic static com.google.appengine.api.datastore.Key createKey(com.google.appengine.api.datastore.Key parent, String kind, Object id)
id
- must be either Long or Stringpublic static List<com.google.appengine.api.datastore.Key> createKeys(com.google.appengine.api.datastore.Key parent, String kind, Iterable<?> ids)
ids
- must contain either Long or Stringpublic static <T> List<Key<T>> createKeys(Key<?> parent, Class<T> kind, Iterable<?> ids)
ids
- must contain either Long or Stringpublic static <S> S getId(com.google.appengine.api.datastore.Key key)
public static <S> S getId(Key<?> key)
public static com.google.appengine.api.datastore.Key getKey(com.google.appengine.api.datastore.PropertyContainer container)
public static void setContainerProperty(com.google.appengine.api.datastore.PropertyContainer entity, String propertyName, Object value, boolean index, SaveContext ctx, Path propPath)
Copyright © 2015. All rights reserved.