|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.astyanax.mapping.Mapping<T>
@Deprecated public class Mapping<T>
Utility for doing object/relational mapping between bean-like instances and Cassandra
The mapper stores values in Cassandra and maps in/out to native types. Column
names must be strings. Annotate your bean with Id and Column.
Or, provide an AnnotationSet that defines IDs and Columns in your
bean.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_ID_COLUMN_NAME
Deprecated. If the ID column does not have a Column annotation, this column name is used |
| Constructor Summary | |
|---|---|
Mapping(java.lang.Class<T> clazz)
Deprecated. |
|
Mapping(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet)
Deprecated. |
|
Mapping(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet,
boolean includeParentFields)
Deprecated. |
|
Mapping(java.lang.Class<T> clazz,
boolean includeParentFields)
Deprecated. |
|
| Method Summary | ||
|---|---|---|
void |
fillMutation(T instance,
ColumnListMutation<java.lang.String> mutation)
Deprecated. Map a bean to a column mutation. |
|
java.util.List<T> |
getAll(Rows<?,java.lang.String> rows)
Deprecated. Load a set of rows into new instances populated with values from the column lists |
|
|
getColumnValue(T instance,
java.lang.String columnName,
java.lang.Class<V> valueClass)
Deprecated. Return the value for the given column from the given instance |
|
|
getIdValue(T instance,
java.lang.Class<V> valueClass)
Deprecated. Return the value for the ID/Key column from the given instance |
|
java.util.Collection<java.lang.String> |
getNames()
Deprecated. Return the set of column names discovered from the bean class |
|
T |
initInstance(T instance,
ColumnList<java.lang.String> columns)
Deprecated. Populate the given instance with the values from the given column list |
|
static
|
make(java.lang.Class<T> clazz)
Deprecated. |
|
static
|
make(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet)
Deprecated. |
|
static
|
make(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet,
boolean includeParentFields)
Deprecated. Convenience for allocation a mapping object |
|
static
|
make(java.lang.Class<T> clazz,
boolean includeParentFields)
Deprecated. Convenience for allocation a mapping object |
|
T |
newInstance(ColumnList<java.lang.String> columns)
Deprecated. Allocate a new instance and populate it with the values from the given column list |
|
|
setColumnValue(T instance,
java.lang.String columnName,
V value)
Deprecated. Set the value for the given column for the given instance |
|
|
setIdValue(T instance,
V value)
Deprecated. Set the value for the ID/Key column for the given instance |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_ID_COLUMN_NAME
| Constructor Detail |
|---|
public Mapping(java.lang.Class<T> clazz,
boolean includeParentFields)
clazz - clazz type to mappublic Mapping(java.lang.Class<T> clazz)
public Mapping(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet,
boolean includeParentFields)
clazz - clazz type to mapannotationSet - annotations to use when analyzing a bean
public Mapping(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet)
| Method Detail |
|---|
public static <T> Mapping<T> make(java.lang.Class<T> clazz,
boolean includeParentFields)
clazz - clazz type to map
public static <T> Mapping<T> make(java.lang.Class<T> clazz)
public static <T> Mapping<T> make(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet,
boolean includeParentFields)
clazz - clazz type to mapannotationSet - annotations to use when analyzing a bean
public static <T> Mapping<T> make(java.lang.Class<T> clazz,
AnnotationSet<?,?> annotationSet)
public <V> V getIdValue(T instance,
java.lang.Class<V> valueClass)
instance - the instancevalueClass - type of the value (must match the actual native type in the
instance's class)
public <V> V getColumnValue(T instance,
java.lang.String columnName,
java.lang.Class<V> valueClass)
instance - the instancecolumnName - name of the column (must match a corresponding annotated field
in the instance's class)valueClass - type of the value (must match the actual native type in the
instance's class)
public <V> void setIdValue(T instance,
V value)
instance - the instancevalue - The value (must match the actual native type in the instance's
class)
public <V> void setColumnValue(T instance,
java.lang.String columnName,
V value)
instance - the instancecolumnName - name of the column (must match a corresponding annotated field
in the instance's class)value - The value (must match the actual native type in the instance's
class)
public void fillMutation(T instance,
ColumnListMutation<java.lang.String> mutation)
instance - instancemutation - mutation
public T newInstance(ColumnList<java.lang.String> columns)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
columns - column list
java.lang.IllegalAccessException - if a new instance could not be instantiated
java.lang.InstantiationException - if a new instance could not be instantiated
public T initInstance(T instance,
ColumnList<java.lang.String> columns)
instance - instancecolumns - column this
public java.util.List<T> getAll(Rows<?,java.lang.String> rows)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException
rows - the rows
java.lang.IllegalAccessException - if a new instance could not be instantiated
java.lang.InstantiationException - if a new instance could not be instantiatedpublic java.util.Collection<java.lang.String> getNames()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||