T - entity typeK - rowKey typepublic interface EntityManager<T,K>
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commit the internal batch after multiple operations.
|
NativeQuery<T,K> |
createNativeQuery()
Execute a 'native' query using a simple API that adheres to cassandra's native
model of rows and columns.
|
void |
createStorage(java.util.Map<java.lang.String,java.lang.Object> options)
Create the underlying storage for this entity.
|
void |
delete(java.util.Collection<K> ids)
Delete a set of entities by their id
|
void |
delete(K id)
delete the whole row by id
|
void |
deleteStorage()
Delete the underlying storage for this entity.
|
java.util.List<T> |
find(java.lang.String cql)
Execute a CQL query and return the found entites
|
java.util.List<T> |
get(java.util.Collection<K> ids) |
T |
get(K id)
fetch whole row and construct entity object mapping from columns
|
java.util.List<T> |
getAll() |
void |
put(java.util.Collection<T> entities)
Store a set of entities.
|
void |
put(T entity)
write entity to cassandra with mapped rowId and columns
|
void |
remove(java.util.Collection<T> entities)
Delete a set of entities
|
void |
remove(T entity)
remove an entire entity
|
void |
truncate()
Truncate all data in the underlying
|
void |
visitAll(com.google.common.base.Function<T,java.lang.Boolean> callback)
Visit all entities.
|
void put(T entity) throws javax.persistence.PersistenceException
entity - entity objectjavax.persistence.PersistenceExceptionT get(K id) throws javax.persistence.PersistenceException
id - row keyjavax.persistence.PersistenceExceptionvoid delete(K id) throws javax.persistence.PersistenceException
id - row keyjavax.persistence.PersistenceExceptionvoid remove(T entity) throws javax.persistence.PersistenceException
id - row keyjavax.persistence.PersistenceExceptionjava.util.List<T> getAll() throws javax.persistence.PersistenceException
javax.persistence.PersistenceExceptionjava.util.List<T> get(java.util.Collection<K> ids) throws javax.persistence.PersistenceException
ids - javax.persistence.PersistenceExceptionvoid delete(java.util.Collection<K> ids) throws javax.persistence.PersistenceException
ids - javax.persistence.PersistenceExceptionvoid remove(java.util.Collection<T> entities) throws javax.persistence.PersistenceException
ids - javax.persistence.PersistenceExceptionvoid put(java.util.Collection<T> entities) throws javax.persistence.PersistenceException
entites - javax.persistence.PersistenceExceptionvoid visitAll(com.google.common.base.Function<T,java.lang.Boolean> callback) throws javax.persistence.PersistenceException
callback - Callback when an entity is read. Note that the callback
may be called from multiple threads.javax.persistence.PersistenceExceptionjava.util.List<T> find(java.lang.String cql) throws javax.persistence.PersistenceException
cql - javax.persistence.PersistenceExceptionNativeQuery<T,K> createNativeQuery()
void createStorage(java.util.Map<java.lang.String,java.lang.Object> options)
throws javax.persistence.PersistenceException
javax.persistence.PersistenceExceptionvoid deleteStorage()
throws javax.persistence.PersistenceException
options - javax.persistence.PersistenceExceptionvoid truncate()
throws javax.persistence.PersistenceException
options - javax.persistence.PersistenceExceptionvoid commit()
throws javax.persistence.PersistenceException
javax.persistence.PersistenceException