Search in sources :

Example 6 with AfterFindByKeyEvent

use of com.google.cloud.spring.data.datastore.core.mapping.event.AfterFindByKeyEvent in project spring-cloud-gcp by GoogleCloudPlatform.

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(com.google.cloud.spring.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 (com.google.cloud.spring.data.datastore.core.mapping.event.AfterFindByKeyEvent)6 Test (org.junit.jupiter.api.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 DatastoreMappingContext (com.google.cloud.spring.data.datastore.core.mapping.DatastoreMappingContext)1 DatastorePersistentEntity (com.google.cloud.spring.data.datastore.core.mapping.DatastorePersistentEntity)1 HashSet (java.util.HashSet)1