I
- type of the row keyK
- type of the column key or namepublic final class CassandraStorable<I extends Serializable,K extends Serializable & Comparable<K>> extends Object implements Storable<I>
Cassandra stores data in the following format:
Map<RowKey, SortedMap<ColumnKey, ColumnValue>>
This class is not thread-safe, but it doesn't have to because the DAO won't use it in a multi-thread environment since instances of this class are not shared among threads.
Constructor and Description |
---|
CassandraStorable(I id)
Creates a cassandra persistent object.
|
CassandraStorable(I id,
String sysId) |
Modifier and Type | Method and Description |
---|---|
void |
delete(ColumnName<K,?> name)
Deletes a column.
|
Column<K,?> |
getColumn(ColumnName<K,?> name)
Gets the value of the given column.
|
Collection<Column<K,?>> |
getColumns()
Gets the columns.
|
Set<ColumnName<K,?>> |
getDeletedColumns()
Gets the columns.
|
I |
getId()
Retrieve the Row Key associated with the Storable.
|
String |
getSysId() |
void |
setColumn(Column<K,?> column)
Sets a column.
|
public CassandraStorable(I id)
id
- row keypublic I getId()
Storable
getId
in interface Storable<I extends Serializable>
public Column<K,?> getColumn(ColumnName<K,?> name)
name
- name of the column to getnull
otherwisepublic void setColumn(Column<K,?> column)
column
- column to setpublic String getSysId()
public void delete(ColumnName<K,?> name)
name
- name of the column to deletepublic Collection<Column<K,?>> getColumns()
public Set<ColumnName<K,?>> getDeletedColumns()
Copyright © 2015. All Rights Reserved.