class EntityManagerKeyValueStore<K, V> : KeyValueStore<K, V>
(source)
JPA-backed key value store.
entityClass
- the class of entity to store
entityManagerProvider
- the provider of entity managers to interact with JPA
coroutineContext
- the kotlin coroutine context.
<init> |
JPA-backed key value store. EntityManagerKeyValueStore(entityManagerProvider: () -> EntityManager, entityClass: Class<V>, idAccessor: (V) -> K, coroutineContext: CoroutineContext = Dispatchers.IO) |
coroutineContext |
the kotlin coroutine context. val coroutineContext: CoroutineContext |
clear |
Clears the contents of the store. suspend fun clear(): Unit |
close |
Close the store fun close(): Unit |
containsKey |
Returns true if the store contains the key. suspend fun containsKey(key: K): Boolean |
get |
Retrieves data from the store. suspend fun get(key: K): V? |
keys |
Provides an iterator over the keys of the store. suspend fun keys(): Iterable<K> |
put |
Convenience method to put a record directly suspend fun put(value: V): Unit
Puts data into the store. suspend fun put(key: K, value: V): Unit |
open |
Open a relational database backed key-value store using a JPA entity manager. fun <K, V> open(entityManagerProvider: Supplier<EntityManager>, entityClass: Class<V>, idAccessor: Function<V, K>): EntityManagerKeyValueStore<K, V> |