|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.astyanax.mapping.MappingUtil
public class MappingUtil
Higher level mapping functions. Methods that behave similar to a Map.
Constructor Summary | |
---|---|
MappingUtil(Keyspace keyspace)
|
|
MappingUtil(Keyspace keyspace,
AnnotationSet<?,?> annotationSet)
|
|
MappingUtil(Keyspace keyspace,
MappingCache cache)
|
|
MappingUtil(Keyspace keyspace,
MappingCache cache,
AnnotationSet<?,?> annotationSet)
|
Method Summary | ||
---|---|---|
|
get(ColumnFamily<K,String> columnFamily,
K id,
Class<T> itemClass)
Get the specified item by its key/id |
|
|
getAll(ColumnFamily<K,String> columnFamily,
Class<T> itemClass)
Get all rows of the specified item |
|
|
getMapping(Class<T> clazz)
Return the mapping instance for the given class |
|
|
put(ColumnFamily<K,String> columnFamily,
T item)
Add/update the given item |
|
|
remove(ColumnFamily<K,String> columnFamily,
T item)
Remove the given item |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MappingUtil(Keyspace keyspace)
keyspace
- keyspace to usepublic MappingUtil(Keyspace keyspace, AnnotationSet<?,?> annotationSet)
keyspace
- keyspace to useannotationSet
- annotation set to usepublic MappingUtil(Keyspace keyspace, MappingCache cache)
keyspace
- keyspace to usecache
- cache to usepublic MappingUtil(Keyspace keyspace, MappingCache cache, AnnotationSet<?,?> annotationSet)
keyspace
- keyspace to usecache
- cache to useannotationSet
- annotation set to useMethod Detail |
---|
public <T,K> void remove(ColumnFamily<K,String> columnFamily, T item) throws Exception
columnFamily
- column family of the itemitem
- the item to remove
Exception
- errorspublic <T,K> void put(ColumnFamily<K,String> columnFamily, T item) throws Exception
columnFamily
- column family of the itemitem
- the item to add/update
Exception
- errorspublic <T,K> T get(ColumnFamily<K,String> columnFamily, K id, Class<T> itemClass) throws Exception
columnFamily
- column family of the itemid
- id/key of the itemitemClass
- item's class
Exception
- errorspublic <T,K> List<T> getAll(ColumnFamily<K,String> columnFamily, Class<T> itemClass) throws Exception
columnFamily
- column family of the itemitemClass
- item's class
Exception
- errorspublic <T> Mapping<T> getMapping(Class<T> clazz)
clazz
- the class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |