org.slim3.datastore
Class Datastore

java.lang.Object
  extended by org.slim3.datastore.Datastore

public final class Datastore
extends Object

A class to access datastore.

Since:
1.0.0
Author:
higa

Field Summary
static String DELEGATE_KEY
          The key of DatastoreDelegate class name.
 
Method Summary
static Key allocateId(Class<?> modelClass)
          Allocates a key within a namespace defined by the kind of the model.
static Key allocateId(Key parentKey, Class<?> modelClass)
          Allocates a key within a namespace defined by the parent key and the kind of the model.
static Key allocateId(Key parentKey, ModelMeta<?> modelMeta)
          Allocates a key within a namespace defined by the parent key and the kind of the model.
static Key allocateId(Key parentKey, String kind)
          Allocates a key within a namespace defined by the parent key and the kind.
static Key allocateId(ModelMeta<?> modelMeta)
          Allocates a key within a namespace defined by the kind of the model.
static Key allocateId(String kind)
          Allocates a key within a namespace defined by the kind.
static KeyRange allocateIds(Class<?> modelClass, long num)
          Allocates keys within a namespace defined by the kind of the model.
static KeyRange allocateIds(Key parentKey, Class<?> modelClass, int num)
          Allocates keys within a namespace defined by the parent key and the kind of the model.
static KeyRange allocateIds(Key parentKey, ModelMeta<?> modelMeta, int num)
          Allocates keys within a namespace defined by the parent key and the kind of the model.
static KeyRange allocateIds(Key parentKey, String kind, int num)
          Allocates keys within a namespace defined by the parent key and the kind.
static KeyRange allocateIds(ModelMeta<?> modelMeta, long num)
          Allocates keys within a namespace defined by the kind of the model.
static KeyRange allocateIds(String kind, long num)
          Allocates keys within a namespace defined by the kind.
static Future<KeyRange> allocateIdsAsync(Class<?> modelClass, long num)
          Allocates keys within a namespace defined by the kind of the model asynchronously.
static Future<KeyRange> allocateIdsAsync(Key parentKey, Class<?> modelClass, int num)
          Allocates keys within a namespace defined by the parent key and the kind of the model asynchronously.
static Future<KeyRange> allocateIdsAsync(Key parentKey, ModelMeta<?> modelMeta, int num)
          Allocates keys within a namespace defined by the parent key and the kind of the model asynchronously.
static Future<KeyRange> allocateIdsAsync(Key parentKey, String kind, int num)
          Allocates keys within a namespace defined by the parent key and the kind asynchronously.
static Future<KeyRange> allocateIdsAsync(ModelMeta<?> modelMeta, long num)
          Allocates keys within a namespace defined by the kind of the model asynchronously.
static Future<KeyRange> allocateIdsAsync(String kind, long num)
          Allocates keys within a namespace defined by the kind asynchronously.
static GlobalTransaction beginGlobalTransaction()
          Begins a global transaction.
static Transaction beginTransaction()
          Begins a transaction.
static void commit(Transaction tx)
          Deprecated. 
static Key createKey(Class<?> modelClass, long id)
          Creates a key.
static Key createKey(Class<?> modelClass, String name)
          Creates a key.
static Key createKey(Key parentKey, Class<?> modelClass, long id)
          Creates a key.
static Key createKey(Key parentKey, Class<?> modelClass, String name)
          Creates a key.
static Key createKey(Key parentKey, ModelMeta<?> modelMeta, long id)
          Creates a key.
static Key createKey(Key parentKey, ModelMeta<?> modelMeta, String name)
          Creates a key.
static Key createKey(Key parentKey, String kind, long id)
          Creates a key.
static Key createKey(Key parentKey, String kind, String name)
          Creates a key.
static Key createKey(ModelMeta<?> modelMeta, long id)
          Creates a key.
static Key createKey(ModelMeta<?> modelMeta, String name)
          Creates a key.
static Key createKey(String kind, long id)
          Creates a key.
static Key createKey(String kind, String name)
          Creates a key.
static DatastoreDelegate deadline(Double deadline)
          Returns a DatastoreDelegate.
static void delete(Iterable<Key> keys)
          Deletes entities specified by the keys.
static void delete(Key... keys)
          Deletes entities specified by the keys.
static void delete(Transaction tx, Iterable<Key> keys)
          Deletes entities specified by the keys within the provided transaction.
static void delete(Transaction tx, Key... keys)
          Deletes entities specified by the keys within the provided transaction.
static void deleteAll(Key ancestorKey)
          Deletes all descendant entities.
static void deleteAll(Transaction tx, Key ancestorKey)
          Deletes all descendant entities within the provided transaction.
static Future<Void> deleteAllAsync(Key ancestorKey)
          Deletes all descendant entities asynchronously.
static Future<Void> deleteAllAsync(Transaction tx, Key ancestorKey)
          Deletes all descendant entities within the provided transaction asynchronously.
static void deleteAllWithoutTx(Key ancestorKey)
          Deletes all descendant entities without transaction.
static Future<Void> deleteAllWithoutTxAsync(Key ancestorKey)
          Deletes all descendant entities without transaction asynchronously.
static Future<Void> deleteAsync(Iterable<Key> keys)
          Deletes entities specified by the keys asynchronously.
static Future<Void> deleteAsync(Key... keys)
          Deletes entities specified by the keys asynchronously.
static Future<Void> deleteAsync(Transaction tx, Iterable<Key> keys)
          Deletes entities specified by the keys within the provided transaction asynchronously.
static Future<Void> deleteAsync(Transaction tx, Key... keys)
          Deletes entities specified by the keys within the provided transaction asynchronously.
static void deleteUniqueValue(String uniqueIndexName, String value)
          Deletes the unique value.
static void deleteWithoutTx(Iterable<Key> keys)
          Deletes entities specified by the keys without transaction.
static void deleteWithoutTx(Key... keys)
          Deletes entities specified by the keys without transaction.
static Future<Void> deleteWithoutTxAsync(Iterable<Key> keys)
          Deletes entities specified by the keys without transaction asynchronously.
static Future<Void> deleteWithoutTxAsync(Key... keys)
          Deletes entities specified by the keys without transaction asynchronously.
static
<M> List<M>
filterInMemory(List<M> list, InMemoryFilterCriterion... criteria)
          Filters the list in memory.
static
<M> List<M>
get(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys.
static
<M> List<M>
get(Class<M> modelClass, Key... keys)
          Returns models specified by the keys.
static
<M> M
get(Class<M> modelClass, Key key)
          Returns a model specified by the key.
static
<M> M
get(Class<M> modelClass, Key key, Long version)
          Returns a model specified by the key and checks the version.
static List<Entity> get(Iterable<Key> keys)
          Returns entities specified by the keys.
static List<Entity> get(Key... keys)
          Returns entities specified by the keys.
static Entity get(Key key)
          Returns an entity specified by the key.
static
<M> List<M>
get(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys.
static
<M> List<M>
get(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys.
static
<M> M
get(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key.
static
<M> M
get(ModelMeta<M> modelMeta, Key key, Long version)
          Returns a model specified by the key and checks the version.
static
<M> List<M>
get(Transaction tx, Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction.
static
<M> List<M>
get(Transaction tx, Class<M> modelClass, Key... keys)
          Returns models specified by the keys within the provided transaction.
static
<M> M
get(Transaction tx, Class<M> modelClass, Key key)
          Returns a model specified by the key within the provided transaction.
static
<M> M
get(Transaction tx, Class<M> modelClass, Key key, Long version)
          Returns a model specified by the key within the provided transaction.
static List<Entity> get(Transaction tx, Iterable<Key> keys)
          Returns entities specified by the keys within the provided transaction.
static List<Entity> get(Transaction tx, Key... keys)
          Returns entities specified by the keys within the provided transaction.
static Entity get(Transaction tx, Key key)
          Returns an entity specified by the key within the provided transaction.
static
<M> List<M>
get(Transaction tx, ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction.
static
<M> List<M>
get(Transaction tx, ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys within the provided transaction.
static
<M> M
get(Transaction tx, ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key within the provided transaction.
static
<M> M
get(Transaction tx, ModelMeta<M> modelMeta, Key key, Long version)
          Returns a model specified by the key within the provided transaction.
static Collection<GlobalTransaction> getActiveGlobalTransactions()
          Returns the active global transactions.
static Collection<Transaction> getActiveTransactions()
          Returns the active transactions.
static
<M> Map<Key,M>
getAsMap(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys.
static
<M> Map<Key,M>
getAsMap(Class<M> modelClass, Key... keys)
          Returns models specified by the keys.
static Map<Key,Entity> getAsMap(Iterable<Key> keys)
          Returns entities specified by the keys.
static Map<Key,Entity> getAsMap(Key... keys)
          Returns entities specified by the keys.
static
<M> Map<Key,M>
getAsMap(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys.
static
<M> Map<Key,M>
getAsMap(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys.
static
<M> Map<Key,M>
getAsMap(Transaction tx, Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction.
static
<M> Map<Key,M>
getAsMap(Transaction tx, Class<M> modelClass, Key... keys)
          Returns models specified by the keys within the provided transaction.
static Map<Key,Entity> getAsMap(Transaction tx, Iterable<Key> keys)
          Returns entities specified by the keys within the provided transaction.
static Map<Key,Entity> getAsMap(Transaction tx, Key... keys)
          Returns entities specified by the keys within the provided transaction.
static
<M> Map<Key,M>
getAsMap(Transaction tx, ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction.
static
<M> Map<Key,M>
getAsMap(Transaction tx, ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys within the provided transaction.
static
<M> Future<Map<Key,M>>
getAsMapAsync(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(Class<M> modelClass, Key... keys)
          Returns models specified by the keys asynchronously.
static Future<Map<Key,Entity>> getAsMapAsync(Iterable<Key> keys)
          Returns entities specified by the keys asynchronously.
static Future<Map<Key,Entity>> getAsMapAsync(Key... keys)
          Returns entities specified by the keys asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(Transaction tx, Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(Transaction tx, Class<M> modelClass, Key... keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static Future<Map<Key,Entity>> getAsMapAsync(Transaction tx, Iterable<Key> keys)
          Returns entities specified by the keys within the provided transaction asynchronously.
static Future<Map<Key,Entity>> getAsMapAsync(Transaction tx, Key... keys)
          Returns entities specified by the keys within the provided transaction asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(Transaction tx, ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapAsync(Transaction tx, ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Map<Key,M>
getAsMapWithoutTx(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys without transaction.
static
<M> Map<Key,M>
getAsMapWithoutTx(Class<M> modelClass, Key... keys)
          Returns models specified by the keys without transaction.
static Map<Key,Entity> getAsMapWithoutTx(Iterable<Key> keys)
          Returns entities specified by the keys without transaction.
static Map<Key,Entity> getAsMapWithoutTx(Key... keys)
          Returns entities specified by the keys without transaction.
static
<M> Map<Key,M>
getAsMapWithoutTx(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys without transaction.
static
<M> Map<Key,M>
getAsMapWithoutTx(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys without transaction.
static
<M> Future<Map<Key,M>>
getAsMapWithoutTxAsync(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapWithoutTxAsync(Class<M> modelClass, Key... keys)
          Returns models specified by the keys without transaction asynchronously.
static Future<Map<Key,Entity>> getAsMapWithoutTxAsync(Iterable<Key> keys)
          Returns entities specified by the keys without transaction asynchronously.
static Future<Map<Key,Entity>> getAsMapWithoutTxAsync(Key... keys)
          Returns entities specified by the keys without transaction asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapWithoutTxAsync(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<Map<Key,M>>
getAsMapWithoutTxAsync(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<List<M>>
getAsync(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<List<M>>
getAsync(Class<M> modelClass, Key... keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<M>
getAsync(Class<M> modelClass, Key key)
          Returns a model specified by the key asynchronously.
static
<M> Future<M>
getAsync(Class<M> modelClass, Key key, Long version)
          Returns a model specified by the key and checks the version asynchronously.
static Future<List<Entity>> getAsync(Iterable<Key> keys)
          Returns entities specified by the keys asynchronously.
static Future<List<Entity>> getAsync(Key... keys)
          Returns entities specified by the keys asynchronously.
static Future<Entity> getAsync(Key key)
          Returns an entity specified by the key asynchronously.
static
<M> Future<List<M>>
getAsync(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<List<M>>
getAsync(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys asynchronously.
static
<M> Future<M>
getAsync(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key asynchronously.
static
<M> Future<M>
getAsync(ModelMeta<M> modelMeta, Key key, Long version)
          Returns a model specified by the key and checks the version asynchronously.
static
<M> Future<List<M>>
getAsync(Transaction tx, Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Future<List<M>>
getAsync(Transaction tx, Class<M> modelClass, Key... keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Future<M>
getAsync(Transaction tx, Class<M> modelClass, Key key)
          Returns a model specified by the key within the provided transaction asynchronously.
static
<M> Future<M>
getAsync(Transaction tx, Class<M> modelClass, Key key, Long version)
          Returns a model specified by the key within the provided transaction asynchronously.
static Future<List<Entity>> getAsync(Transaction tx, Iterable<Key> keys)
          Returns entities specified by the keys within the provided transaction asynchronously.
static Future<List<Entity>> getAsync(Transaction tx, Key... keys)
          Returns entities specified by the keys within the provided transaction asynchronously.
static Future<Entity> getAsync(Transaction tx, Key key)
          Returns an entity specified by the key within the provided transaction asynchronously.
static
<M> Future<List<M>>
getAsync(Transaction tx, ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Future<List<M>>
getAsync(Transaction tx, ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys within the provided transaction asynchronously.
static
<M> Future<M>
getAsync(Transaction tx, ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key within the provided transaction asynchronously.
static
<M> Future<M>
getAsync(Transaction tx, ModelMeta<M> modelMeta, Key key, Long version)
          Returns a model specified by the key within the provided transaction asynchronously.
static GlobalTransaction getCurrentGlobalTransaction()
          Returns the current global transaction.
static Transaction getCurrentTransaction()
          Returns the current transaction.
static
<M> ModelMeta<M>
getModelMeta(Class<M> modelClass)
          Returns a meta data of the model
static
<M> M
getOrNull(Class<M> modelClass, Key key)
          Returns a model specified by the key.
static Entity getOrNull(Key key)
          Returns an entity specified by the key.
static
<M> M
getOrNull(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key.
static
<M> M
getOrNull(Transaction tx, Class<M> modelClass, Key key)
          Returns a model specified by the key within the provided transaction.
static Entity getOrNull(Transaction tx, Key key)
          Returns an entity specified by the key within the provided transaction.
static
<M> M
getOrNull(Transaction tx, ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key within the provided transaction.
static
<M> Future<M>
getOrNullAsync(Class<M> modelClass, Key key)
          Returns a model specified by the key asynchronously.
static Future<Entity> getOrNullAsync(Key key)
          Returns an entity specified by the key asynchronously.
static
<M> Future<M>
getOrNullAsync(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key asynchronously.
static
<M> Future<M>
getOrNullAsync(Transaction tx, Class<M> modelClass, Key key)
          Returns a model specified by the key within the provided transaction asynchronously.
static Future<Entity> getOrNullAsync(Transaction tx, Key key)
          Returns an entity specified by the key within the provided transaction asynchronously.
static
<M> Future<M>
getOrNullAsync(Transaction tx, ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key within the provided transaction asynchronously.
static
<M> M
getOrNullWithoutTx(Class<M> modelClass, Key key)
          Returns a model specified by the key without transaction.
static Entity getOrNullWithoutTx(Key key)
          Returns an entity specified by the key without transaction.
static
<M> M
getOrNullWithoutTx(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key without transaction.
static
<M> Future<M>
getOrNullWithoutTxAsync(Class<M> modelClass, Key key)
          Returns a model specified by the key without transaction asynchronously.
static Future<Entity> getOrNullWithoutTxAsync(Key key)
          Returns an entity specified by the key without transaction asynchronously.
static
<M> Future<M>
getOrNullWithoutTxAsync(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key without transaction asynchronously.
static
<M> List<M>
getWithoutTx(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys without transaction.
static
<M> List<M>
getWithoutTx(Class<M> modelClass, Key... keys)
          Returns models specified by the keys without transaction.
static
<M> M
getWithoutTx(Class<M> modelClass, Key key)
          Returns a model specified by the key without transaction.
static List<Entity> getWithoutTx(Iterable<Key> keys)
          Returns entities specified by the keys without transaction.
static List<Entity> getWithoutTx(Key... keys)
          Returns entities specified by the keys.
static Entity getWithoutTx(Key key)
          Returns an entity specified by the key without transaction.
static
<M> List<M>
getWithoutTx(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys without transaction.
static
<M> List<M>
getWithoutTx(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys without transaction.
static
<M> M
getWithoutTx(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key without transaction.
static
<M> Future<List<M>>
getWithoutTxAsync(Class<M> modelClass, Iterable<Key> keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<List<M>>
getWithoutTxAsync(Class<M> modelClass, Key... keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<M>
getWithoutTxAsync(Class<M> modelClass, Key key)
          Returns a model specified by the key without transaction asynchronously.
static Future<List<Entity>> getWithoutTxAsync(Iterable<Key> keys)
          Returns entities specified by the keys without transaction asynchronously.
static Future<List<Entity>> getWithoutTxAsync(Key... keys)
          Returns entities specified by the keys asynchronously.
static Future<Entity> getWithoutTxAsync(Key key)
          Returns an entity specified by the key without transaction asynchronously.
static
<M> Future<List<M>>
getWithoutTxAsync(ModelMeta<M> modelMeta, Iterable<Key> keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<List<M>>
getWithoutTxAsync(ModelMeta<M> modelMeta, Key... keys)
          Returns models specified by the keys without transaction asynchronously.
static
<M> Future<M>
getWithoutTxAsync(ModelMeta<M> modelMeta, Key key)
          Returns a model specified by the key without transaction asynchronously.
static String keyToString(Key key)
          Converts the key to an encoded string.
static Key put(Entity entity)
          Puts the entity to datastore.
static List<Key> put(Iterable<?> models)
          Puts the models or entities to datastore.
static List<Key> put(Object... models)
          Puts the models or entities to datastore.
static Key put(Object model)
          Puts the model to datastore.
static Key put(Transaction tx, Entity entity)
          Puts the entity to datastore within the provided transaction.
static List<Key> put(Transaction tx, Iterable<?> models)
          Puts the models or entities to datastore within the provided transaction.
static List<Key> put(Transaction tx, Object... models)
          Puts the models or entities to datastore within the provided transaction.
static Key put(Transaction tx, Object model)
          Puts the model to datastore within the provided transaction.
static Future<Key> putAsync(Entity entity)
          Puts the entity to datastore asynchronously.
static Future<List<Key>> putAsync(Iterable<?> models)
          Puts the models or entities to datastore asynchronously.
static Future<List<Key>> putAsync(Object... models)
          Puts the models or entities to datastore asynchronously.
static Future<Key> putAsync(Object model)
          Puts the model to datastore asynchronously.
static Future<Key> putAsync(Transaction tx, Entity entity)
          Puts the entity to datastore within the provided transaction asynchronously.
static Future<List<Key>> putAsync(Transaction tx, Iterable<?> models)
          Puts the models or entities to datastore within the provided transaction asynchronously.
static Future<List<Key>> putAsync(Transaction tx, Object... models)
          Puts the models or entities to datastore within the provided transaction asynchronously.
static Future<Key> putAsync(Transaction tx, Object model)
          Puts the model to datastore within the provided transaction asynchronously.
static boolean putUniqueValue(String uniqueIndexName, String value)
          Puts the unique value.
static Key putWithoutTx(Entity entity)
          Puts the entity to datastore without transaction.
static List<Key> putWithoutTx(Iterable<?> models)
          Puts the models or entities to datastore without transaction.
static List<Key> putWithoutTx(Object... models)
          Puts the models or entities to datastore without transaction.
static Key putWithoutTx(Object model)
          Puts the model to datastore without transaction.
static Future<Key> putWithoutTxAsync(Entity entity)
          Puts the entity to datastore without transaction asynchronously.
static Future<List<Key>> putWithoutTxAsync(Iterable<?> models)
          Puts the models or entities to datastore without transaction asynchronously.
static Future<List<Key>> putWithoutTxAsync(Object... models)
          Puts the models or entities to datastore without transaction asynchronously.
static Future<Key> putWithoutTxAsync(Object model)
          Puts the model to datastore without transaction asynchronously.
static KindlessQuery query()
          Returns a KindlessQuery.
static
<M> ModelQuery<M>
query(Class<M> modelClass)
          Returns a ModelQuery.
static
<M> ModelQuery<M>
query(Class<M> modelClass, Key ancestorKey)
          Returns a ModelQuery.
static KindlessQuery query(Key ancestorKey)
          Returns a KindlessQuery.
static
<M> ModelQuery<M>
query(ModelMeta<M> modelMeta)
          Returns a ModelQuery.
static
<M> ModelQuery<M>
query(ModelMeta<M> modelMeta, Key ancestorKey)
          Returns a ModelQuery.
static EntityQuery query(String kind)
          Returns an EntityQuery.
static EntityQuery query(String kind, Key ancestorKey)
          Returns an EntityQuery.
static
<M> ModelQuery<M>
query(Transaction tx, Class<M> modelClass, Key ancestorKey)
          Returns a ModelQuery.
static KindlessQuery query(Transaction tx, Key ancestorKey)
          Returns a KindlessQuery.
static
<M> ModelQuery<M>
query(Transaction tx, ModelMeta<M> modelMeta, Key ancestorKey)
          Returns a ModelQuery.
static EntityQuery query(Transaction tx, String kind, Key ancestorKey)
          Returns an EntityQuery.
static void rollback(Transaction tx)
          Deprecated. 
static void setGlobalCipherKey(String key)
          Sets the global key for cipher.
static void setLimitedCipherKey(String key)
          Sets the limited key for cipher to the current thread.
static
<M> List<M>
sortInMemory(List<M> list, InMemorySortCriterion... criteria)
          Sorts the list.
static Key stringToKey(String encodedKey)
          Converts the encoded string to a key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELEGATE_KEY

public static final String DELEGATE_KEY
The key of DatastoreDelegate class name.

See Also:
Constant Field Values
Method Detail

deadline

public static DatastoreDelegate deadline(Double deadline)
                                  throws IllegalStateException
Returns a DatastoreDelegate.

Parameters:
deadline - the deadline
Returns:
a DatastoreDelegate
Throws:
IllegalStateException - if a DatastoreDelegate cannot be instantiated

beginTransaction

public static Transaction beginTransaction()
Begins a transaction.

Returns:
a begun transaction

commit

@Deprecated
public static void commit(Transaction tx)
Deprecated. 

Use Transaction.commit() directly.

Parameters:
tx - the transaction

rollback

@Deprecated
public static void rollback(Transaction tx)
Deprecated. 

Use Transaction.rollback() directly.

Parameters:
tx - the transaction

getActiveTransactions

public static Collection<Transaction> getActiveTransactions()
Returns the active transactions.

Returns:
the active transactions

getCurrentTransaction

public static Transaction getCurrentTransaction()
Returns the current transaction. Returns null if there is no transaction.

Returns:
the current transaction

beginGlobalTransaction

public static GlobalTransaction beginGlobalTransaction()
Begins a global transaction.

Returns:
a begun global transaction

getActiveGlobalTransactions

public static Collection<GlobalTransaction> getActiveGlobalTransactions()
Returns the active global transactions.

Returns:
the active global transactions

getCurrentGlobalTransaction

public static GlobalTransaction getCurrentGlobalTransaction()
Returns the current global transaction. Returns null if there is no transaction.

Returns:
the current global transaction

allocateId

public static Key allocateId(String kind)
                      throws NullPointerException
Allocates a key within a namespace defined by the kind.

Parameters:
kind - the kind
Returns:
a key within a namespace defined by the kind
Throws:
NullPointerException - if the kind parameter is null

allocateId

public static Key allocateId(Class<?> modelClass)
                      throws NullPointerException
Allocates a key within a namespace defined by the kind of the model.

Parameters:
modelClass - the model class
Returns:
a key within a namespace defined by the kind of the model
Throws:
NullPointerException - if the modelClass parameter is null

allocateId

public static Key allocateId(ModelMeta<?> modelMeta)
                      throws NullPointerException
Allocates a key within a namespace defined by the kind of the model.

Parameters:
modelMeta - the meta data of the model
Returns:
a key within a namespace defined by the kind of the model
Throws:
NullPointerException - if the modelMeta parameter is null

allocateId

public static Key allocateId(Key parentKey,
                             String kind)
                      throws NullPointerException
Allocates a key within a namespace defined by the parent key and the kind.

Parameters:
parentKey - the parent key
kind - the kind
Returns:
a key within a namespace defined by the parent key and the kind
Throws:
NullPointerException - if the parentKey parameter is null or if the kind parameter is null

allocateId

public static Key allocateId(Key parentKey,
                             Class<?> modelClass)
                      throws NullPointerException
Allocates a key within a namespace defined by the parent key and the kind of the model.

Parameters:
parentKey - the parent key
modelClass - the model class
Returns:
a key within a namespace defined by the parent key and the kind of the model
Throws:
NullPointerException - if the parentKey parameter is null or if the modelClass parameter is null

allocateId

public static Key allocateId(Key parentKey,
                             ModelMeta<?> modelMeta)
                      throws NullPointerException
Allocates a key within a namespace defined by the parent key and the kind of the model.

Parameters:
parentKey - the parent key
modelMeta - the meta data of the model
Returns:
a key within a namespace defined by the parent key and the kind of the model
Throws:
NullPointerException - if the parentKey parameter is null or if the modelMeta parameter is null

allocateIds

public static KeyRange allocateIds(String kind,
                                   long num)
                            throws NullPointerException
Allocates keys within a namespace defined by the kind.

Parameters:
kind - the kind
num - the number of allocated keys
Returns:
keys within a namespace defined by the kind
Throws:
NullPointerException - if the kind parameter is null

allocateIdsAsync

public static Future<KeyRange> allocateIdsAsync(String kind,
                                                long num)
                                         throws NullPointerException
Allocates keys within a namespace defined by the kind asynchronously.

Parameters:
kind - the kind
num - the number of allocated keys
Returns:
keys represented as Future
Throws:
NullPointerException - if the kind parameter is null

allocateIds

public static KeyRange allocateIds(Class<?> modelClass,
                                   long num)
                            throws NullPointerException
Allocates keys within a namespace defined by the kind of the model.

Parameters:
modelClass - the model class
num - the number of allocated keys
Returns:
keys within a namespace defined by the kind of the model
Throws:
NullPointerException - if the modelClass parameter is null

allocateIdsAsync

public static Future<KeyRange> allocateIdsAsync(Class<?> modelClass,
                                                long num)
                                         throws NullPointerException
Allocates keys within a namespace defined by the kind of the model asynchronously.

Parameters:
modelClass - the model class
num - the number of allocated keys
Returns:
keys represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

allocateIds

public static KeyRange allocateIds(ModelMeta<?> modelMeta,
                                   long num)
Allocates keys within a namespace defined by the kind of the model.

Parameters:
modelMeta - the meta data of the model
num - the number of allocated keys
Returns:
keys within a namespace defined by the kind of the model

allocateIdsAsync

public static Future<KeyRange> allocateIdsAsync(ModelMeta<?> modelMeta,
                                                long num)
Allocates keys within a namespace defined by the kind of the model asynchronously.

Parameters:
modelMeta - the meta data of the model
num - the number of allocated keys
Returns:
keys represented as Future

allocateIds

public static KeyRange allocateIds(Key parentKey,
                                   String kind,
                                   int num)
                            throws NullPointerException
Allocates keys within a namespace defined by the parent key and the kind.

Parameters:
parentKey - the parent key
kind - the kind
num -
Returns:
keys within a namespace defined by the parent key and the kind
Throws:
NullPointerException - if the parentKey parameter is null or if the kind parameter is null

allocateIdsAsync

public static Future<KeyRange> allocateIdsAsync(Key parentKey,
                                                String kind,
                                                int num)
                                         throws NullPointerException
Allocates keys within a namespace defined by the parent key and the kind asynchronously.

Parameters:
parentKey - the parent key
kind - the kind
num -
Returns:
keys represented as Future
Throws:
NullPointerException - if the parentKey parameter is null or if the kind parameter is null

allocateIds

public static KeyRange allocateIds(Key parentKey,
                                   Class<?> modelClass,
                                   int num)
                            throws NullPointerException
Allocates keys within a namespace defined by the parent key and the kind of the model.

Parameters:
parentKey - the parent key
modelClass - the model class
num -
Returns:
keys within a namespace defined by the parent key and the kind of the model
Throws:
NullPointerException - if the parentKey parameter is null or if the modelClass parameter is null

allocateIdsAsync

public static Future<KeyRange> allocateIdsAsync(Key parentKey,
                                                Class<?> modelClass,
                                                int num)
                                         throws NullPointerException
Allocates keys within a namespace defined by the parent key and the kind of the model asynchronously.

Parameters:
parentKey - the parent key
modelClass - the model class
num -
Returns:
keys represented as Future
Throws:
NullPointerException - if the parentKey parameter is null or if the modelClass parameter is null

allocateIds

public static KeyRange allocateIds(Key parentKey,
                                   ModelMeta<?> modelMeta,
                                   int num)
                            throws NullPointerException
Allocates keys within a namespace defined by the parent key and the kind of the model.

Parameters:
parentKey - the parent key
modelMeta - the meta data of the model
num -
Returns:
keys within a namespace defined by the parent key and the kind of the model
Throws:
NullPointerException - if the parentKey parameter is null or if the modelMeta parameter is null

allocateIdsAsync

public static Future<KeyRange> allocateIdsAsync(Key parentKey,
                                                ModelMeta<?> modelMeta,
                                                int num)
                                         throws NullPointerException
Allocates keys within a namespace defined by the parent key and the kind of the model asynchronously.

Parameters:
parentKey - the parent key
modelMeta - the meta data of the model
num -
Returns:
keys represented as Future
Throws:
NullPointerException - if the parentKey parameter is null or if the modelMeta parameter is null

createKey

public static Key createKey(String kind,
                            long id)
                     throws NullPointerException
Creates a key.

Parameters:
kind - the kind of entity
id - the identifier
Returns:
a key
Throws:
NullPointerException - if the kind parameter is null

createKey

public static Key createKey(Class<?> modelClass,
                            long id)
                     throws NullPointerException
Creates a key.

Parameters:
modelClass - the model class
id - the identifier
Returns:
a key
Throws:
NullPointerException - if the modelClass parameter is null

createKey

public static Key createKey(ModelMeta<?> modelMeta,
                            long id)
                     throws NullPointerException
Creates a key.

Parameters:
modelMeta - the meta data of the model
id - the identifier
Returns:
a key
Throws:
NullPointerException - if the modelMeta parameter is null

createKey

public static Key createKey(String kind,
                            String name)
                     throws NullPointerException
Creates a key.

Parameters:
kind - the kind of entity
name - the name
Returns:
a key
Throws:
NullPointerException - if the kind parameter is null or if the name parameter is null

createKey

public static Key createKey(Class<?> modelClass,
                            String name)
                     throws NullPointerException
Creates a key.

Parameters:
modelClass - the model class
name - the name
Returns:
a key
Throws:
NullPointerException - if the modeClass parameter is null or if the name parameter is null

createKey

public static Key createKey(ModelMeta<?> modelMeta,
                            String name)
                     throws NullPointerException
Creates a key.

Parameters:
modelMeta - the meta data of the model
name - the name
Returns:
a key
Throws:
NullPointerException - if the modelMeta parameter is null or if the name parameter is null

createKey

public static Key createKey(Key parentKey,
                            String kind,
                            long id)
                     throws NullPointerException
Creates a key.

Parameters:
parentKey - the parent key
kind - the kind of entity
id - the identifier
Returns:
a key
Throws:
NullPointerException - if the parentKey parameter is null or if the kind parameter is null

createKey

public static Key createKey(Key parentKey,
                            Class<?> modelClass,
                            long id)
                     throws NullPointerException
Creates a key.

Parameters:
parentKey - the parent key
modelClass - the model class
id - the identifier
Returns:
a key
Throws:
NullPointerException - if the parentKey parameter is null or if the modelClass parameter is null

createKey

public static Key createKey(Key parentKey,
                            ModelMeta<?> modelMeta,
                            long id)
                     throws NullPointerException
Creates a key.

Parameters:
parentKey - the parent key
modelMeta - the meta data of the model
id - the identifier
Returns:
a key
Throws:
NullPointerException - if the parentKey parameter is null or if the modelMeta parameter is null

createKey

public static Key createKey(Key parentKey,
                            String kind,
                            String name)
                     throws NullPointerException
Creates a key.

Parameters:
parentKey - the parent key
kind - the kind of entity
name - the name
Returns:
a key
Throws:
NullPointerException - if the parentKey parameter is null or if the kind parameter is null or if the name parameter is null

createKey

public static Key createKey(Key parentKey,
                            Class<?> modelClass,
                            String name)
                     throws NullPointerException
Creates a key.

Parameters:
parentKey - the parent key
modelClass - the model class
name - the name
Returns:
a key
Throws:
NullPointerException - if the parentKey is null or if the modelClass parameter is null or if the name parameter is null

createKey

public static Key createKey(Key parentKey,
                            ModelMeta<?> modelMeta,
                            String name)
                     throws NullPointerException
Creates a key.

Parameters:
parentKey - the parent key
modelMeta - the meta data of the model
name - the name
Returns:
a key
Throws:
NullPointerException - if the parentKey is null or if the modelMeta parameter is null or if the name parameter is null

keyToString

public static String keyToString(Key key)
                          throws NullPointerException
Converts the key to an encoded string.

Parameters:
key - the key
Returns:
an encoded string
Throws:
NullPointerException - if the key parameter is null

stringToKey

public static Key stringToKey(String encodedKey)
                       throws NullPointerException
Converts the encoded string to a key.

Parameters:
encodedKey - the encoded string
Returns:
a key
Throws:
NullPointerException - if the encodedKey parameter is null

putUniqueValue

public static boolean putUniqueValue(String uniqueIndexName,
                                     String value)
                              throws NullPointerException
Puts the unique value.

Parameters:
uniqueIndexName - the unique index name
value - the unique value
Returns:
whether the unique value is put
Throws:
NullPointerException - if the uniqueIndexName parameter is null or if the value parameter is null

deleteUniqueValue

public static void deleteUniqueValue(String uniqueIndexName,
                                     String value)
                              throws NullPointerException
Deletes the unique value.

Parameters:
uniqueIndexName - the unique index name
value - the unique value
Throws:
NullPointerException - if the uniqueIndexName parameter is null or if the value parameter is null

get

public static Entity get(Key key)
                  throws NullPointerException,
                         EntityNotFoundRuntimeException
Returns an entity specified by the key. If there is a current transaction, this operation will execute within that transaction.

Parameters:
key - the key
Returns:
an entity specified by the key
Throws:
NullPointerException - if the key parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getAsync

public static Future<Entity> getAsync(Key key)
                               throws NullPointerException
Returns an entity specified by the key asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
key - the key
Returns:
an entity represented as Future
Throws:
NullPointerException - if the key parameter is null

get

public static <M> M get(Class<M> modelClass,
                        Key key)
             throws NullPointerException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException
Returns a model specified by the key. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<M> getAsync(Class<M> modelClass,
                                     Key key)
                          throws NullPointerException
Returns a model specified by the key asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

get

public static <M> M get(ModelMeta<M> modelMeta,
                        Key key)
             throws NullPointerException,
                    EntityNotFoundRuntimeException
Returns a model specified by the key. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getAsync

public static <M> Future<M> getAsync(ModelMeta<M> modelMeta,
                                     Key key)
                          throws NullPointerException
Returns a model specified by the key asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null

getOrNull

public static Entity getOrNull(Key key)
                        throws NullPointerException
Returns an entity specified by the key. Returns null if no entity is found. If there is a current transaction, this operation will execute within that transaction.

Parameters:
key - the key
Returns:
an entity specified by the key
Throws:
NullPointerException - if the key parameter is null

getOrNullAsync

public static Future<Entity> getOrNullAsync(Key key)
                                     throws NullPointerException
Returns an entity specified by the key asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
key - the key
Returns:
an entity represented as Future
Throws:
NullPointerException - if the key parameter is null

getOrNull

public static <M> M getOrNull(Class<M> modelClass,
                              Key key)
                   throws NullPointerException,
                          IllegalArgumentException
Returns a model specified by the key. Returns null if no entity is found. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getOrNullAsync

public static <M> Future<M> getOrNullAsync(Class<M> modelClass,
                                           Key key)
                                throws NullPointerException
Returns a model specified by the key asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

getOrNull

public static <M> M getOrNull(ModelMeta<M> modelMeta,
                              Key key)
                   throws NullPointerException,
                          IllegalArgumentException
Returns a model specified by the key. Returns null if no entity is found. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getOrNullAsync

public static <M> Future<M> getOrNullAsync(ModelMeta<M> modelMeta,
                                           Key key)
                                throws NullPointerException,
                                       IllegalArgumentException
Returns a model specified by the key asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getWithoutTx

public static Entity getWithoutTx(Key key)
                           throws NullPointerException,
                                  EntityNotFoundRuntimeException
Returns an entity specified by the key without transaction.

Parameters:
key - the key
Returns:
an entity specified by the key
Throws:
NullPointerException - if the key parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getWithoutTxAsync

public static Future<Entity> getWithoutTxAsync(Key key)
                                        throws NullPointerException
Returns an entity specified by the key without transaction asynchronously.

Parameters:
key - the key
Returns:
an entity represented as Future
Throws:
NullPointerException - if the key parameter is null

getWithoutTx

public static <M> M getWithoutTx(Class<M> modelClass,
                                 Key key)
                      throws NullPointerException,
                             EntityNotFoundRuntimeException,
                             IllegalArgumentException
Returns a model specified by the key without transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getWithoutTxAsync

public static <M> Future<M> getWithoutTxAsync(Class<M> modelClass,
                                              Key key)
                                   throws NullPointerException
Returns a model specified by the key without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

getWithoutTx

public static <M> M getWithoutTx(ModelMeta<M> modelMeta,
                                 Key key)
                      throws NullPointerException,
                             EntityNotFoundRuntimeException
Returns a model specified by the key without transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getWithoutTxAsync

public static <M> Future<M> getWithoutTxAsync(ModelMeta<M> modelMeta,
                                              Key key)
                                   throws NullPointerException
Returns a model specified by the key without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null

getOrNullWithoutTx

public static Entity getOrNullWithoutTx(Key key)
                                 throws NullPointerException
Returns an entity specified by the key without transaction. Returns null if no entity is found.

Parameters:
key - the key
Returns:
an entity specified by the key
Throws:
NullPointerException - if the key parameter is null

getOrNullWithoutTxAsync

public static Future<Entity> getOrNullWithoutTxAsync(Key key)
                                              throws NullPointerException
Returns an entity specified by the key without transaction asynchronously.

Parameters:
key - the key
Returns:
an entity represented as Future
Throws:
NullPointerException - if the key parameter is null

getOrNullWithoutTx

public static <M> M getOrNullWithoutTx(Class<M> modelClass,
                                       Key key)
                            throws NullPointerException,
                                   IllegalArgumentException
Returns a model specified by the key without transaction. Returns null if no entity is found.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getOrNullWithoutTxAsync

public static <M> Future<M> getOrNullWithoutTxAsync(Class<M> modelClass,
                                                    Key key)
                                         throws NullPointerException
Returns a model specified by the key without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

getOrNullWithoutTx

public static <M> M getOrNullWithoutTx(ModelMeta<M> modelMeta,
                                       Key key)
                            throws NullPointerException,
                                   IllegalArgumentException
Returns a model specified by the key without transaction. Returns null if no entity is found.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getOrNullWithoutTxAsync

public static <M> Future<M> getOrNullWithoutTxAsync(ModelMeta<M> modelMeta,
                                                    Key key)
                                         throws NullPointerException
Returns a model specified by the key without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null

get

public static <M> M get(Class<M> modelClass,
                        Key key,
                        Long version)
             throws NullPointerException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException,
                    ConcurrentModificationException
Returns a model specified by the key and checks the version. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
version - the version
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null or if the key parameter is null or if the version parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class
ConcurrentModificationException - if the version of the model is updated

getAsync

public static <M> Future<M> getAsync(Class<M> modelClass,
                                     Key key,
                                     Long version)
                          throws NullPointerException
Returns a model specified by the key and checks the version asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
key - the key
version - the version
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or if the key parameter is null or if the version parameter is null

get

public static <M> M get(ModelMeta<M> modelMeta,
                        Key key,
                        Long version)
             throws NullPointerException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException,
                    ConcurrentModificationException
Returns a model specified by the key and checks the version. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
version - the version
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null or if the key parameter is null or if the version parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class
ConcurrentModificationException - if the version of the model is updated

getAsync

public static <M> Future<M> getAsync(ModelMeta<M> modelMeta,
                                     Key key,
                                     Long version)
                          throws NullPointerException
Returns a model specified by the key and checks the version asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
key - the key
version - the version
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the key parameter is null or if the version parameter is null

get

public static Entity get(Transaction tx,
                         Key key)
                  throws NullPointerException,
                         IllegalStateException,
                         EntityNotFoundRuntimeException
Returns an entity specified by the key within the provided transaction.

Parameters:
tx - the transaction
key - the key
Returns:
an entity specified by the key
Throws:
NullPointerException - if the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key is found

getAsync

public static Future<Entity> getAsync(Transaction tx,
                                      Key key)
                               throws NullPointerException,
                                      IllegalStateException
Returns an entity specified by the key within the provided transaction asynchronously.

Parameters:
tx - the transaction
key - the key
Returns:
an entity represented as Future
Throws:
NullPointerException - if the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> M get(Transaction tx,
                        Class<M> modelClass,
                        Key key)
             throws NullPointerException,
                    IllegalStateException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException
Returns a model specified by the key within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null or the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<M> getAsync(Transaction tx,
                                     Class<M> modelClass,
                                     Key key)
                          throws NullPointerException,
                                 IllegalStateException
Returns a model specified by the key within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> M get(Transaction tx,
                        ModelMeta<M> modelMeta,
                        Key key)
             throws NullPointerException,
                    IllegalStateException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException
Returns a model specified by the key within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<M> getAsync(Transaction tx,
                                     ModelMeta<M> modelMeta,
                                     Key key)
                          throws NullPointerException,
                                 IllegalStateException
Returns a model specified by the key within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getOrNull

public static Entity getOrNull(Transaction tx,
                               Key key)
                        throws NullPointerException,
                               IllegalStateException
Returns an entity specified by the key within the provided transaction. Returns null if no entity is found.

Parameters:
tx - the transaction
key - the key
Returns:
an entity specified by the key
Throws:
NullPointerException - if the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getOrNullAsync

public static Future<Entity> getOrNullAsync(Transaction tx,
                                            Key key)
                                     throws NullPointerException,
                                            IllegalStateException
Returns an entity specified by the key within the provided transaction asynchronously.

Parameters:
tx - the transaction
key - the key
Returns:
an entity represented as Future
Throws:
NullPointerException - if the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getOrNull

public static <M> M getOrNull(Transaction tx,
                              Class<M> modelClass,
                              Key key)
                   throws NullPointerException,
                          IllegalStateException,
                          IllegalArgumentException
Returns a model specified by the key within the provided transaction. Returns null if no entity is found.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null or the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getOrNullAsync

public static <M> Future<M> getOrNullAsync(Transaction tx,
                                           Class<M> modelClass,
                                           Key key)
                                throws NullPointerException,
                                       IllegalStateException
Returns a model specified by the key within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or the key parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getOrNull

public static <M> M getOrNull(Transaction tx,
                              ModelMeta<M> modelMeta,
                              Key key)
                   throws NullPointerException,
                          IllegalStateException,
                          IllegalArgumentException
Returns a model specified by the key within the provided transaction. Returns null if no entity is found.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
key - the key
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getOrNullAsync

public static <M> Future<M> getOrNullAsync(Transaction tx,
                                           ModelMeta<M> modelMeta,
                                           Key key)
                                throws NullPointerException,
                                       IllegalStateException
Returns a model specified by the key within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
key - the key
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> M get(Transaction tx,
                        Class<M> modelClass,
                        Key key,
                        Long version)
             throws NullPointerException,
                    IllegalStateException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException,
                    ConcurrentModificationException
Returns a model specified by the key within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
key - the key
version - the version
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelClass parameter is null or if the key parameter is null or if the version parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class
ConcurrentModificationException - if the version of the model is updated

getAsync

public static <M> Future<M> getAsync(Transaction tx,
                                     Class<M> modelClass,
                                     Key key,
                                     Long version)
                          throws NullPointerException,
                                 IllegalStateException
Returns a model specified by the key within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
key - the key
version - the version
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or if the key parameter is null or if the version parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> M get(Transaction tx,
                        ModelMeta<M> modelMeta,
                        Key key,
                        Long version)
             throws NullPointerException,
                    IllegalStateException,
                    EntityNotFoundRuntimeException,
                    IllegalArgumentException,
                    ConcurrentModificationException
Returns a model specified by the key within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
key - the key
version - the version
Returns:
a model specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null or if the key parameter is null or if the version parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class
ConcurrentModificationException - if the version of the model is updated

getAsync

public static <M> Future<M> getAsync(Transaction tx,
                                     ModelMeta<M> modelMeta,
                                     Key key,
                                     Long version)
                          throws NullPointerException,
                                 IllegalStateException
Returns a model specified by the key within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
key - the key
version - the version
Returns:
a model represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the key parameter is null or if the version parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static List<Entity> get(Iterable<Key> keys)
                        throws NullPointerException,
                               EntityNotFoundRuntimeException
Returns entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getAsync

public static Future<List<Entity>> getAsync(Iterable<Key> keys)
                                     throws NullPointerException
Returns entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the keys parameter is null

get

public static List<Entity> get(Key... keys)
                        throws EntityNotFoundRuntimeException
Returns entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities specified by the key
Throws:
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getAsync

public static Future<List<Entity>> getAsync(Key... keys)
Returns entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities represented as Future

get

public static <M> List<M> get(Class<M> modelClass,
                              Iterable<Key> keys)
                   throws NullPointerException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null of if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(Class<M> modelClass,
                                           Iterable<Key> keys)
                                throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null of if the keys parameter is null

get

public static <M> List<M> get(ModelMeta<M> modelMeta,
                              Iterable<Key> keys)
                   throws NullPointerException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null of if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(ModelMeta<M> modelMeta,
                                           Iterable<Key> keys)
                                throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null of if the keys parameter is null

get

public static <M> List<M> get(Class<M> modelClass,
                              Key... keys)
                   throws NullPointerException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(Class<M> modelClass,
                                           Key... keys)
                                throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

get

public static <M> List<M> get(ModelMeta<M> modelMeta,
                              Key... keys)
                   throws NullPointerException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(ModelMeta<M> modelMeta,
                                           Key... keys)
                                throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null

getWithoutTx

public static List<Entity> getWithoutTx(Iterable<Key> keys)
                                 throws NullPointerException,
                                        EntityNotFoundRuntimeException
Returns entities specified by the keys without transaction.

Parameters:
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getWithoutTxAsync

public static Future<List<Entity>> getWithoutTxAsync(Iterable<Key> keys)
                                              throws NullPointerException
Returns entities specified by the keys without transaction asynchronously.

Parameters:
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the keys parameter is null

getWithoutTx

public static List<Entity> getWithoutTx(Key... keys)
                                 throws EntityNotFoundRuntimeException
Returns entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities specified by the key
Throws:
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getWithoutTxAsync

public static Future<List<Entity>> getWithoutTxAsync(Key... keys)
Returns entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities represented as Future

getWithoutTx

public static <M> List<M> getWithoutTx(Class<M> modelClass,
                                       Iterable<Key> keys)
                            throws NullPointerException,
                                   EntityNotFoundRuntimeException,
                                   IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null of if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getWithoutTxAsync

public static <M> Future<List<M>> getWithoutTxAsync(Class<M> modelClass,
                                                    Iterable<Key> keys)
                                         throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null of if the keys parameter is null

getWithoutTx

public static <M> List<M> getWithoutTx(ModelMeta<M> modelMeta,
                                       Iterable<Key> keys)
                            throws NullPointerException,
                                   EntityNotFoundRuntimeException,
                                   IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null of if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getWithoutTxAsync

public static <M> Future<List<M>> getWithoutTxAsync(ModelMeta<M> modelMeta,
                                                    Iterable<Key> keys)
                                         throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null of if the keys parameter is null

getWithoutTx

public static <M> List<M> getWithoutTx(Class<M> modelClass,
                                       Key... keys)
                            throws NullPointerException,
                                   EntityNotFoundRuntimeException,
                                   IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getWithoutTxAsync

public static <M> Future<List<M>> getWithoutTxAsync(Class<M> modelClass,
                                                    Key... keys)
                                         throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

getWithoutTx

public static <M> List<M> getWithoutTx(ModelMeta<M> modelMeta,
                                       Key... keys)
                            throws NullPointerException,
                                   EntityNotFoundRuntimeException,
                                   IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getWithoutTxAsync

public static <M> Future<List<M>> getWithoutTxAsync(ModelMeta<M> modelMeta,
                                                    Key... keys)
                                         throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null

get

public static List<Entity> get(Transaction tx,
                               Iterable<Key> keys)
                        throws NullPointerException,
                               IllegalStateException,
                               EntityNotFoundRuntimeException
Returns entities specified by the keys within the provided transaction.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getAsync

public static Future<List<Entity>> getAsync(Transaction tx,
                                            Iterable<Key> keys)
                                     throws NullPointerException,
                                            IllegalStateException
Returns entities specified by the keys within the provided transaction asynchronously.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static List<Entity> get(Transaction tx,
                               Key... keys)
                        throws IllegalStateException,
                               EntityNotFoundRuntimeException
Returns entities specified by the keys within the provided transaction.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities specified by the key
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found

getAsync

public static Future<List<Entity>> getAsync(Transaction tx,
                                            Key... keys)
                                     throws IllegalStateException
Returns entities specified by the keys within the provided transaction asynchronously.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities represented as Future
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> List<M> get(Transaction tx,
                              Class<M> modelClass,
                              Iterable<Key> keys)
                   throws NullPointerException,
                          IllegalStateException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(Transaction tx,
                                           Class<M> modelClass,
                                           Iterable<Key> keys)
                                throws NullPointerException,
                                       IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> List<M> get(Transaction tx,
                              ModelMeta<M> modelMeta,
                              Iterable<Key> keys)
                   throws NullPointerException,
                          IllegalStateException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(Transaction tx,
                                           ModelMeta<M> modelMeta,
                                           Iterable<Key> keys)
                                throws NullPointerException,
                                       IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> List<M> get(Transaction tx,
                              Class<M> modelClass,
                              Key... keys)
                   throws NullPointerException,
                          IllegalStateException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(Transaction tx,
                                           Class<M> modelClass,
                                           Key... keys)
                                throws NullPointerException,
                                       IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

get

public static <M> List<M> get(Transaction tx,
                              ModelMeta<M> modelMeta,
                              Key... keys)
                   throws NullPointerException,
                          IllegalStateException,
                          EntityNotFoundRuntimeException,
                          IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
EntityNotFoundRuntimeException - if no entity specified by the key could be found
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsync

public static <M> Future<List<M>> getAsync(Transaction tx,
                                           ModelMeta<M> modelMeta,
                                           Key... keys)
                                throws NullPointerException,
                                       IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMap

public static Map<Key,Entity> getAsMap(Iterable<Key> keys)
                                throws NullPointerException
Returns entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities specified by the keys
Throws:
NullPointerException - if the keys parameter is null

getAsMapAsync

public static Future<Map<Key,Entity>> getAsMapAsync(Iterable<Key> keys)
                                             throws NullPointerException
Returns entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the keys parameter is null

getAsMap

public static Map<Key,Entity> getAsMap(Key... keys)
Returns entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities specified by the keys

getAsMapAsync

public static Future<Map<Key,Entity>> getAsMapAsync(Key... keys)
Returns entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
entities represented as Future

getAsMap

public static <M> Map<Key,M> getAsMap(Class<M> modelClass,
                                      Iterable<Key> keys)
                           throws NullPointerException,
                                  IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(Class<M> modelClass,
                                                   Iterable<Key> keys)
                                        throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null

getAsMap

public static <M> Map<Key,M> getAsMap(ModelMeta<M> modelMeta,
                                      Iterable<Key> keys)
                           throws NullPointerException,
                                  IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(ModelMeta<M> modelMeta,
                                                   Iterable<Key> keys)
                                        throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null

getAsMap

public static <M> Map<Key,M> getAsMap(Class<M> modelClass,
                                      Key... keys)
                           throws NullPointerException,
                                  IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(Class<M> modelClass,
                                                   Key... keys)
                                        throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

getAsMap

public static <M> Map<Key,M> getAsMap(ModelMeta<M> modelMeta,
                                      Key... keys)
                           throws NullPointerException,
                                  IllegalArgumentException
Returns models specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(ModelMeta<M> modelMeta,
                                                   Key... keys)
                                        throws NullPointerException
Returns models specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null

getAsMapWithoutTx

public static Map<Key,Entity> getAsMapWithoutTx(Iterable<Key> keys)
                                         throws NullPointerException
Returns entities specified by the keys without transaction.

Parameters:
keys - the keys
Returns:
entities specified by the keys
Throws:
NullPointerException - if the keys parameter is null

getAsMapWithoutTxAsync

public static Future<Map<Key,Entity>> getAsMapWithoutTxAsync(Iterable<Key> keys)
                                                      throws NullPointerException
Returns entities specified by the keys without transaction asynchronously.

Parameters:
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the keys parameter is null

getAsMapWithoutTx

public static Map<Key,Entity> getAsMapWithoutTx(Key... keys)
Returns entities specified by the keys without transaction.

Parameters:
keys - the keys
Returns:
entities specified by the keys

getAsMapWithoutTxAsync

public static Future<Map<Key,Entity>> getAsMapWithoutTxAsync(Key... keys)
Returns entities specified by the keys without transaction asynchronously.

Parameters:
keys - the keys
Returns:
entities represented as Future

getAsMapWithoutTx

public static <M> Map<Key,M> getAsMapWithoutTx(Class<M> modelClass,
                                               Iterable<Key> keys)
                                    throws NullPointerException,
                                           IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapWithoutTxAsync

public static <M> Future<Map<Key,M>> getAsMapWithoutTxAsync(Class<M> modelClass,
                                                            Iterable<Key> keys)
                                                 throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null

getAsMapWithoutTx

public static <M> Map<Key,M> getAsMapWithoutTx(ModelMeta<M> modelMeta,
                                               Iterable<Key> keys)
                                    throws NullPointerException,
                                           IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapWithoutTxAsync

public static <M> Future<Map<Key,M>> getAsMapWithoutTxAsync(ModelMeta<M> modelMeta,
                                                            Iterable<Key> keys)
                                                 throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null

getAsMapWithoutTx

public static <M> Map<Key,M> getAsMapWithoutTx(Class<M> modelClass,
                                               Key... keys)
                                    throws NullPointerException,
                                           IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelClass parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapWithoutTxAsync

public static <M> Future<Map<Key,M>> getAsMapWithoutTxAsync(Class<M> modelClass,
                                                            Key... keys)
                                                 throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelClass parameter is null

getAsMapWithoutTx

public static <M> Map<Key,M> getAsMapWithoutTx(ModelMeta<M> modelMeta,
                                               Key... keys)
                                    throws NullPointerException,
                                           IllegalArgumentException
Returns models specified by the keys without transaction.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models specified by the keys
Throws:
NullPointerException - if the modelMeta parameter is null
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapWithoutTxAsync

public static <M> Future<Map<Key,M>> getAsMapWithoutTxAsync(ModelMeta<M> modelMeta,
                                                            Key... keys)
                                                 throws NullPointerException
Returns models specified by the keys without transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
keys - the keys
Returns:
models represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null

getAsMap

public static Map<Key,Entity> getAsMap(Transaction tx,
                                       Iterable<Key> keys)
                                throws NullPointerException,
                                       IllegalStateException
Returns entities specified by the keys within the provided transaction.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities specified by the keys
Throws:
NullPointerException - if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMapAsync

public static Future<Map<Key,Entity>> getAsMapAsync(Transaction tx,
                                                    Iterable<Key> keys)
                                             throws NullPointerException,
                                                    IllegalStateException
Returns entities specified by the keys within the provided transaction asynchronously.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMap

public static Map<Key,Entity> getAsMap(Transaction tx,
                                       Key... keys)
                                throws IllegalStateException
Returns entities specified by the keys within the provided transaction.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities specified by the keys
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMapAsync

public static Future<Map<Key,Entity>> getAsMapAsync(Transaction tx,
                                                    Key... keys)
                                             throws IllegalStateException
Returns entities specified by the keys within the provided transaction asynchronously.

Parameters:
tx - the transaction
keys - the keys
Returns:
entities represented as Future
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMap

public static <M> Map<Key,M> getAsMap(Transaction tx,
                                      Class<M> modelClass,
                                      Iterable<Key> keys)
                           throws NullPointerException,
                                  IllegalStateException,
                                  IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(Transaction tx,
                                                   Class<M> modelClass,
                                                   Iterable<Key> keys)
                                        throws NullPointerException,
                                               IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMap

public static <M> Map<Key,M> getAsMap(Transaction tx,
                                      ModelMeta<M> modelMeta,
                                      Iterable<Key> keys)
                           throws NullPointerException,
                                  IllegalStateException,
                                  IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(Transaction tx,
                                                   ModelMeta<M> modelMeta,
                                                   Iterable<Key> keys)
                                        throws NullPointerException,
                                               IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMap

public static <M> Map<Key,M> getAsMap(Transaction tx,
                                      Class<M> modelClass,
                                      Key... keys)
                           throws NullPointerException,
                                  IllegalStateException,
                                  IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(Transaction tx,
                                                   Class<M> modelClass,
                                                   Key... keys)
                                        throws NullPointerException,
                                               IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the modelClass parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

getAsMap

public static <M> Map<Key,M> getAsMap(Transaction tx,
                                      ModelMeta<M> modelMeta,
                                      Key... keys)
                           throws NullPointerException,
                                  IllegalStateException,
                                  IllegalArgumentException
Returns models specified by the keys within the provided transaction.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
entities specified by the key
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active
IllegalArgumentException - if the kind of the key is different from the kind of the model or if the model class is not assignable from entity class

getAsMapAsync

public static <M> Future<Map<Key,M>> getAsMapAsync(Transaction tx,
                                                   ModelMeta<M> modelMeta,
                                                   Key... keys)
                                        throws NullPointerException,
                                               IllegalStateException
Returns models specified by the keys within the provided transaction asynchronously.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
keys - the keys
Returns:
entities represented as Future
Throws:
NullPointerException - if the modelMeta parameter is null or if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

put

public static Key put(Entity entity)
               throws NullPointerException
Puts the entity to datastore. If there is a current transaction, this operation will execute within that transaction.

Parameters:
entity - the entity
Returns:
a key
Throws:
NullPointerException - if the entity parameter is null

putAsync

public static Future<Key> putAsync(Entity entity)
                            throws NullPointerException
Puts the entity to datastore asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
entity - the entity
Returns:
a key represented as Future
Throws:
NullPointerException - if the entity parameter is null

putWithoutTx

public static Key putWithoutTx(Entity entity)
                        throws NullPointerException
Puts the entity to datastore without transaction.

Parameters:
entity - the entity
Returns:
a key
Throws:
NullPointerException - if the entity parameter is null

putWithoutTxAsync

public static Future<Key> putWithoutTxAsync(Entity entity)
                                     throws NullPointerException
Puts the entity to datastore without transaction asynchronously.

Parameters:
entity - the entity
Returns:
a key represented as Future
Throws:
NullPointerException - if the entity parameter is null

put

public static Key put(Object model)
               throws NullPointerException
Puts the model to datastore. If there is a current transaction, this operation will execute within that transaction.

Parameters:
model - the model
Returns:
a key
Throws:
NullPointerException - if the model parameter is null

putAsync

public static Future<Key> putAsync(Object model)
                            throws NullPointerException
Puts the model to datastore asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
model - the model
Returns:
a key represented as Future
Throws:
NullPointerException - if the model parameter is null

putWithoutTx

public static Key putWithoutTx(Object model)
                        throws NullPointerException
Puts the model to datastore without transaction.

Parameters:
model - the model
Returns:
a key
Throws:
NullPointerException - if the model parameter is null

putWithoutTxAsync

public static Future<Key> putWithoutTxAsync(Object model)
                                     throws NullPointerException
Puts the model to datastore without transaction asynchronously.

Parameters:
model - the model
Returns:
a key represented as Future
Throws:
NullPointerException - if the model parameter is null

put

public static Key put(Transaction tx,
                      Entity entity)
               throws NullPointerException,
                      IllegalStateException
Puts the entity to datastore within the provided transaction.

Parameters:
tx - the transaction
entity - the entity
Returns:
a key
Throws:
NullPointerException - if the entity parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

putAsync

public static Future<Key> putAsync(Transaction tx,
                                   Entity entity)
                            throws NullPointerException,
                                   IllegalStateException
Puts the entity to datastore within the provided transaction asynchronously.

Parameters:
tx - the transaction
entity - the entity
Returns:
a key represented as Future
Throws:
NullPointerException - if the entity parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

put

public static Key put(Transaction tx,
                      Object model)
               throws NullPointerException,
                      IllegalStateException
Puts the model to datastore within the provided transaction.

Parameters:
tx - the transaction
model - the model
Returns:
a key
Throws:
NullPointerException - if the model parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

putAsync

public static Future<Key> putAsync(Transaction tx,
                                   Object model)
                            throws NullPointerException,
                                   IllegalStateException
Puts the model to datastore within the provided transaction asynchronously.

Parameters:
tx - the transaction
model - the model
Returns:
a key represented as Future
Throws:
NullPointerException - if the model parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

put

public static List<Key> put(Iterable<?> models)
                     throws NullPointerException
Puts the models or entities to datastore. If there is a current transaction, this operation will execute within that transaction.

Parameters:
models - the models or entities
Returns:
a list of keys
Throws:
NullPointerException - if the models parameter is null

putAsync

public static Future<List<Key>> putAsync(Iterable<?> models)
                                  throws NullPointerException
Puts the models or entities to datastore asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
models - the models or entities
Returns:
a list of keys represented as Future
Throws:
NullPointerException - if the models parameter is null

putWithoutTx

public static List<Key> putWithoutTx(Iterable<?> models)
                              throws NullPointerException
Puts the models or entities to datastore without transaction.

Parameters:
models - the models or entities
Returns:
a list of keys
Throws:
NullPointerException - if the models parameter is null

putWithoutTxAsync

public static Future<List<Key>> putWithoutTxAsync(Iterable<?> models)
                                           throws NullPointerException
Puts the models or entities to datastore without transaction asynchronously.

Parameters:
models - the models or entities
Returns:
a list of keys represented as Future
Throws:
NullPointerException - if the models parameter is null

put

public static List<Key> put(Object... models)
Puts the models or entities to datastore. If there is a current transaction, this operation will execute within that transaction.

Parameters:
models - the models or entities
Returns:
a list of keys

putAsync

public static Future<List<Key>> putAsync(Object... models)
Puts the models or entities to datastore asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
models - the models or entities
Returns:
a list of keys represented as Future

putWithoutTx

public static List<Key> putWithoutTx(Object... models)
Puts the models or entities to datastore without transaction.

Parameters:
models - the models or entities
Returns:
a list of keys

putWithoutTxAsync

public static Future<List<Key>> putWithoutTxAsync(Object... models)
Puts the models or entities to datastore without transaction asynchronously.

Parameters:
models - the models or entities
Returns:
a list of keys represented as Future

put

public static List<Key> put(Transaction tx,
                            Iterable<?> models)
                     throws NullPointerException,
                            IllegalStateException
Puts the models or entities to datastore within the provided transaction.

Parameters:
tx - the transaction
models - the models or entities
Returns:
a list of keys
Throws:
NullPointerException - if the models parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

putAsync

public static Future<List<Key>> putAsync(Transaction tx,
                                         Iterable<?> models)
                                  throws NullPointerException,
                                         IllegalStateException
Puts the models or entities to datastore within the provided transaction asynchronously.

Parameters:
tx - the transaction
models - the models or entities
Returns:
a list of keys represented as Future
Throws:
NullPointerException - if the models parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

put

public static List<Key> put(Transaction tx,
                            Object... models)
                     throws IllegalStateException
Puts the models or entities to datastore within the provided transaction.

Parameters:
tx - the transaction
models - the models or entities
Returns:
a list of keys
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

putAsync

public static Future<List<Key>> putAsync(Transaction tx,
                                         Object... models)
                                  throws IllegalStateException
Puts the models or entities to datastore within the provided transaction asynchronously.

Parameters:
tx - the transaction
models - the models or entities
Returns:
a list of keys represented as Future
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

delete

public static void delete(Iterable<Key> keys)
                   throws NullPointerException
Deletes entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Throws:
NullPointerException - if the keys parameter is null

deleteAsync

public static Future<Void> deleteAsync(Iterable<Key> keys)
                                throws NullPointerException
Deletes entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
a Void represented as Future
Throws:
NullPointerException - if the keys parameter is null

deleteWithoutTx

public static void deleteWithoutTx(Iterable<Key> keys)
                            throws NullPointerException
Deletes entities specified by the keys without transaction.

Parameters:
keys - the keys
Throws:
NullPointerException - if the keys parameter is null

deleteWithoutTxAsync

public static Future<Void> deleteWithoutTxAsync(Iterable<Key> keys)
                                         throws NullPointerException
Deletes entities specified by the keys without transaction asynchronously.

Parameters:
keys - the keys
Returns:
a Void represented as Future
Throws:
NullPointerException - if the keys parameter is null

delete

public static void delete(Key... keys)
Deletes entities specified by the keys. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys

deleteAsync

public static Future<Void> deleteAsync(Key... keys)
Deletes entities specified by the keys asynchronously. If there is a current transaction, this operation will execute within that transaction.

Parameters:
keys - the keys
Returns:
a Void represented as Future

deleteWithoutTx

public static void deleteWithoutTx(Key... keys)
Deletes entities specified by the keys without transaction.

Parameters:
keys - the keys

deleteWithoutTxAsync

public static Future<Void> deleteWithoutTxAsync(Key... keys)
Deletes entities specified by the keys without transaction asynchronously.

Parameters:
keys - the keys
Returns:
a Void represented as Future

delete

public static void delete(Transaction tx,
                          Iterable<Key> keys)
                   throws NullPointerException,
                          IllegalStateException
Deletes entities specified by the keys within the provided transaction.

Parameters:
tx - the transaction
keys - the keys
Throws:
NullPointerException - if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

deleteAsync

public static Future<Void> deleteAsync(Transaction tx,
                                       Iterable<Key> keys)
                                throws NullPointerException,
                                       IllegalStateException
Deletes entities specified by the keys within the provided transaction asynchronously.

Parameters:
tx - the transaction
keys - the keys
Returns:
a Void represented as Future
Throws:
NullPointerException - if the keys parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

delete

public static void delete(Transaction tx,
                          Key... keys)
                   throws IllegalStateException
Deletes entities specified by the keys within the provided transaction.

Parameters:
tx - the transaction
keys - the keys
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

deleteAsync

public static Future<Void> deleteAsync(Transaction tx,
                                       Key... keys)
                                throws IllegalStateException
Deletes entities specified by the keys within the provided transaction asynchronously.

Parameters:
tx - the transaction
keys - the keys
Returns:
a Void represented as Future
Throws:
IllegalStateException - if the transaction is not null and the transaction is not active

deleteAll

public static void deleteAll(Key ancestorKey)
                      throws NullPointerException
Deletes all descendant entities.

Parameters:
ancestorKey - the ancestor key
Throws:
NullPointerException - if the ancestorKey parameter is null

deleteAllAsync

public static Future<Void> deleteAllAsync(Key ancestorKey)
                                   throws NullPointerException
Deletes all descendant entities asynchronously.

Parameters:
ancestorKey - the ancestor key
Returns:
a Void represented as Future
Throws:
NullPointerException - if the ancestorKey parameter is null

deleteAll

public static void deleteAll(Transaction tx,
                             Key ancestorKey)
                      throws NullPointerException,
                             IllegalStateException
Deletes all descendant entities within the provided transaction.

Parameters:
tx - the transaction
ancestorKey - the ancestor key
Throws:
NullPointerException - if the ancestorKey parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

deleteAllAsync

public static Future<Void> deleteAllAsync(Transaction tx,
                                          Key ancestorKey)
                                   throws NullPointerException,
                                          IllegalStateException
Deletes all descendant entities within the provided transaction asynchronously.

Parameters:
tx - the transaction
ancestorKey - the ancestor key
Returns:
a Void represented as Future
Throws:
NullPointerException - if the ancestorKey parameter is null
IllegalStateException - if the transaction is not null and the transaction is not active

deleteAllWithoutTx

public static void deleteAllWithoutTx(Key ancestorKey)
                               throws NullPointerException
Deletes all descendant entities without transaction.

Parameters:
ancestorKey - the ancestor key
Throws:
NullPointerException - if the ancestorKey parameter is null

deleteAllWithoutTxAsync

public static Future<Void> deleteAllWithoutTxAsync(Key ancestorKey)
                                            throws NullPointerException
Deletes all descendant entities without transaction asynchronously.

Parameters:
ancestorKey - the ancestor key
Returns:
a Void represented as Future
Throws:
NullPointerException - if the ancestorKey parameter is null

query

public static <M> ModelQuery<M> query(Class<M> modelClass)
                           throws NullPointerException
Returns a ModelQuery.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
Returns:
a ModelQuery
Throws:
NullPointerException - if the modelClass parameter is null

query

public static <M> ModelQuery<M> query(ModelMeta<M> modelMeta)
                           throws NullPointerException
Returns a ModelQuery.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
Returns:
a ModelQuery
Throws:
NullPointerException - if the modelMeta parameter is null

query

public static <M> ModelQuery<M> query(Class<M> modelClass,
                                      Key ancestorKey)
                           throws NullPointerException
Returns a ModelQuery.

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
ancestorKey - the ancestor key
Returns:
a ModelQuery
Throws:
NullPointerException - if the modelClass parameter is null or if the ancestorKey parameter is null

query

public static <M> ModelQuery<M> query(ModelMeta<M> modelMeta,
                                      Key ancestorKey)
                           throws NullPointerException
Returns a ModelQuery.

Type Parameters:
M - the model type
Parameters:
modelMeta - the meta data of model
ancestorKey - the ancestor key
Returns:
a ModelQuery
Throws:
NullPointerException - if the modelMeta parameter is null or if the ancestorKey parameter is null

query

public static <M> ModelQuery<M> query(Transaction tx,
                                      Class<M> modelClass,
                                      Key ancestorKey)
                           throws NullPointerException
Returns a ModelQuery.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelClass - the model class
ancestorKey - the ancestor key
Returns:
a ModelQuery
Throws:
NullPointerException - if the modelClass parameter is null or if the ancestorKey parameter is null

query

public static <M> ModelQuery<M> query(Transaction tx,
                                      ModelMeta<M> modelMeta,
                                      Key ancestorKey)
                           throws NullPointerException
Returns a ModelQuery.

Type Parameters:
M - the model type
Parameters:
tx - the transaction
modelMeta - the meta data of model
ancestorKey - the ancestor key
Returns:
a ModelQuery
Throws:
NullPointerException - if the modelMeta parameter is null or if the ancestorKey parameter is null

query

public static EntityQuery query(String kind)
                         throws NullPointerException
Returns an EntityQuery.

Parameters:
kind - the kind
Returns:
an EntityQuery
Throws:
NullPointerException - if the kind parameter is null

query

public static EntityQuery query(String kind,
                                Key ancestorKey)
                         throws NullPointerException
Returns an EntityQuery.

Parameters:
kind - the kind
ancestorKey - the ancestor key
Returns:
an EntityQuery
Throws:
NullPointerException - if the kind parameter is null or if the ancestorKey parameter is null

query

public static EntityQuery query(Transaction tx,
                                String kind,
                                Key ancestorKey)
                         throws NullPointerException
Returns an EntityQuery.

Parameters:
tx - the transaction
kind - the kind
ancestorKey - the ancestor key
Returns:
an EntityQuery
Throws:
NullPointerException - if the kind parameter is null or if the ancestorKey parameter is null

query

public static KindlessQuery query()
Returns a KindlessQuery.

Returns:
a KindlessQuery

query

public static KindlessQuery query(Key ancestorKey)
                           throws NullPointerException
Returns a KindlessQuery.

Parameters:
ancestorKey - the ancestor key
Returns:
a KindlessQuery
Throws:
NullPointerException - if the ancestorKey parameter is null

query

public static KindlessQuery query(Transaction tx,
                                  Key ancestorKey)
                           throws NullPointerException
Returns a KindlessQuery.

Parameters:
tx - the transaction
ancestorKey - the ancestor key
Returns:
a KindlessQuery
Throws:
NullPointerException - if the ancestorKey parameter is null

getModelMeta

public static <M> ModelMeta<M> getModelMeta(Class<M> modelClass)
                                 throws NullPointerException
Returns a meta data of the model

Type Parameters:
M - the model type
Parameters:
modelClass - the model class
Returns:
a meta data of the model
Throws:
NullPointerException - if the modelClass parameter is null

filterInMemory

public static <M> List<M> filterInMemory(List<M> list,
                                         InMemoryFilterCriterion... criteria)
                              throws NullPointerException
Filters the list in memory.

Type Parameters:
M - the model type
Parameters:
list - the model list
criteria - the filter criteria
Returns:
the filtered list.
Throws:
NullPointerException - if the list parameter is null or if the model of the list is null

sortInMemory

public static <M> List<M> sortInMemory(List<M> list,
                                       InMemorySortCriterion... criteria)
                            throws NullPointerException
Sorts the list.

Type Parameters:
M - the model type
Parameters:
list - the model list
criteria - criteria to sort
Returns:
the sorted list
Throws:
NullPointerException - if the list parameter is null or if the criteria parameter is null

setLimitedCipherKey

public static void setLimitedCipherKey(String key)
Sets the limited key for cipher to the current thread.

Parameters:
key - the key
Since:
1.0.6

setGlobalCipherKey

public static void setGlobalCipherKey(String key)
Sets the global key for cipher.

Parameters:
key - the key
Since:
1.0.6


Copyright © 2009-2010 The Slim3 project. All Rights Reserved.