Search in sources :

Example 6 with AfterFindByKeyEvent

use of org.springframework.cloud.gcp.data.datastore.core.mapping.event.AfterFindByKeyEvent in project spring-cloud-gcp by spring-cloud.

the class DatastoreTemplate method performFindByKey.

private <T> Collection<T> performFindByKey(Iterable<?> ids, Class<T> entityClass) {
    Set<Key> keys = getKeysFromIds(ids, entityClass);
    List<T> results = findAllById(keys, entityClass, new ReadContext());
    maybeEmitEvent(new AfterFindByKeyEvent(results, keys));
    return results;
}
Also used : AfterFindByKeyEvent(org.springframework.cloud.gcp.data.datastore.core.mapping.event.AfterFindByKeyEvent) IncompleteKey(com.google.cloud.datastore.IncompleteKey) Key(com.google.cloud.datastore.Key) BaseKey(com.google.cloud.datastore.BaseKey)

Aggregations

AfterFindByKeyEvent (org.springframework.cloud.gcp.data.datastore.core.mapping.event.AfterFindByKeyEvent)6 Test (org.junit.Test)5 Key (com.google.cloud.datastore.Key)3 BaseKey (com.google.cloud.datastore.BaseKey)1 Entity (com.google.cloud.datastore.Entity)1 FullEntity (com.google.cloud.datastore.FullEntity)1 IncompleteKey (com.google.cloud.datastore.IncompleteKey)1 HashSet (java.util.HashSet)1