com.netflix.astyanax.mapping
Class Mapping<T>

java.lang.Object
  extended by com.netflix.astyanax.mapping.Mapping<T>

Deprecated. please use DefaultEntityManager instead

@Deprecated
public class Mapping<T>
extends java.lang.Object

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
<V> V
getColumnValue(T instance, java.lang.String columnName, java.lang.Class<V> valueClass)
          Deprecated. Return the value for the given column from the given instance
<V> V
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
<T> Mapping<T>
make(java.lang.Class<T> clazz)
          Deprecated.  
static
<T> Mapping<T>
make(java.lang.Class<T> clazz, AnnotationSet<?,?> annotationSet)
          Deprecated.  
static
<T> Mapping<T>
make(java.lang.Class<T> clazz, AnnotationSet<?,?> annotationSet, boolean includeParentFields)
          Deprecated. Convenience for allocation a mapping object
static
<T> Mapping<T>
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
<V> void
setColumnValue(T instance, java.lang.String columnName, V value)
          Deprecated. Set the value for the given column for the given instance
<V> void
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

DEFAULT_ID_COLUMN_NAME

public static final java.lang.String DEFAULT_ID_COLUMN_NAME
Deprecated. 
If the ID column does not have a Column annotation, this column name is used

See Also:
Constant Field Values
Constructor Detail

Mapping

public Mapping(java.lang.Class<T> clazz,
               boolean includeParentFields)
Deprecated. 
Parameters:
clazz - clazz type to map

Mapping

public Mapping(java.lang.Class<T> clazz)
Deprecated. 

Mapping

public Mapping(java.lang.Class<T> clazz,
               AnnotationSet<?,?> annotationSet,
               boolean includeParentFields)
Deprecated. 
Parameters:
clazz - clazz type to map
annotationSet - annotations to use when analyzing a bean

Mapping

public Mapping(java.lang.Class<T> clazz,
               AnnotationSet<?,?> annotationSet)
Deprecated. 
Method Detail

make

public static <T> Mapping<T> make(java.lang.Class<T> clazz,
                                  boolean includeParentFields)
Deprecated. 
Convenience for allocation a mapping object

Parameters:
clazz - clazz type to map
Returns:
mapper

make

public static <T> Mapping<T> make(java.lang.Class<T> clazz)
Deprecated. 

make

public static <T> Mapping<T> make(java.lang.Class<T> clazz,
                                  AnnotationSet<?,?> annotationSet,
                                  boolean includeParentFields)
Deprecated. 
Convenience for allocation a mapping object

Parameters:
clazz - clazz type to map
annotationSet - annotations to use when analyzing a bean
Returns:
mapper

make

public static <T> Mapping<T> make(java.lang.Class<T> clazz,
                                  AnnotationSet<?,?> annotationSet)
Deprecated. 

getIdValue

public <V> V getIdValue(T instance,
                        java.lang.Class<V> valueClass)
Deprecated. 
Return the value for the ID/Key column from the given instance

Parameters:
instance - the instance
valueClass - type of the value (must match the actual native type in the instance's class)
Returns:
value

getColumnValue

public <V> V getColumnValue(T instance,
                            java.lang.String columnName,
                            java.lang.Class<V> valueClass)
Deprecated. 
Return the value for the given column from the given instance

Parameters:
instance - the instance
columnName - 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)
Returns:
value

setIdValue

public <V> void setIdValue(T instance,
                           V value)
Deprecated. 
Set the value for the ID/Key column for the given instance

Parameters:
instance - the instance
value - The value (must match the actual native type in the instance's class)

setColumnValue

public <V> void setColumnValue(T instance,
                               java.lang.String columnName,
                               V value)
Deprecated. 
Set the value for the given column for the given instance

Parameters:
instance - the instance
columnName - 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)

fillMutation

public void fillMutation(T instance,
                         ColumnListMutation<java.lang.String> mutation)
Deprecated. 
Map a bean to a column mutation. i.e. set the columns in the mutation to the corresponding values from the instance

Parameters:
instance - instance
mutation - mutation

newInstance

public T newInstance(ColumnList<java.lang.String> columns)
              throws java.lang.IllegalAccessException,
                     java.lang.InstantiationException
Deprecated. 
Allocate a new instance and populate it with the values from the given column list

Parameters:
columns - column list
Returns:
the allocated instance
Throws:
java.lang.IllegalAccessException - if a new instance could not be instantiated
java.lang.InstantiationException - if a new instance could not be instantiated

initInstance

public T initInstance(T instance,
                      ColumnList<java.lang.String> columns)
Deprecated. 
Populate the given instance with the values from the given column list

Parameters:
instance - instance
columns - column this
Returns:
instance (as a convenience for chaining)

getAll

public java.util.List<T> getAll(Rows<?,java.lang.String> rows)
                         throws java.lang.InstantiationException,
                                java.lang.IllegalAccessException
Deprecated. 
Load a set of rows into new instances populated with values from the column lists

Parameters:
rows - the rows
Returns:
list of new instances
Throws:
java.lang.IllegalAccessException - if a new instance could not be instantiated
java.lang.InstantiationException - if a new instance could not be instantiated

getNames

public java.util.Collection<java.lang.String> getNames()
Deprecated. 
Return the set of column names discovered from the bean class

Returns:
column names