public class MappingCassandraConverter extends AbstractCassandraConverter implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanClassLoaderAware
Constructor and Description |
---|
MappingCassandraConverter()
Create a new
MappingCassandraConverter with a CassandraMappingContext . |
MappingCassandraConverter(CassandraMappingContext mappingContext)
Create a new
MappingCassandraConverter with the given CassandraMappingContext . |
Modifier and Type | Method and Description |
---|---|
Object |
convertToColumnType(Object obj)
Converts the given object into a value Cassandra will be able to store natively in a column.
|
Object |
convertToColumnType(Object value,
org.springframework.data.util.TypeInformation<?> typeInformation)
Converts the given object into a value Cassandra will be able to store natively in a column.
|
Object |
getId(Object object,
CassandraPersistentEntity<?> entity)
Returns the Id for an entity.
|
CassandraMappingContext |
getMappingContext() |
<R> R |
read(Class<R> type,
Object row) |
<R> R |
readRow(Class<R> type,
com.datastax.driver.core.Row row)
Read a
Row into the requested target type . |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
write(Object source,
Object sink) |
void |
write(Object source,
Object sink,
CassandraPersistentEntity<?> entity)
|
afterPropertiesSet, getConversionService, getCustomConversions, setCustomConversions, setInstantiators
public MappingCassandraConverter()
MappingCassandraConverter
with a CassandraMappingContext
.public MappingCassandraConverter(CassandraMappingContext mappingContext)
MappingCassandraConverter
with the given CassandraMappingContext
.mappingContext
- must not be null.public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public CassandraMappingContext getMappingContext()
getMappingContext
in interface CassandraConverter
getMappingContext
in interface org.springframework.data.convert.EntityConverter<CassandraPersistentEntity<?>,CassandraPersistentProperty,Object,Object>
public <R> R readRow(Class<R> type, com.datastax.driver.core.Row row)
Row
into the requested target type
.type
- must not be null.row
- must not be null.public Object convertToColumnType(Object obj)
CassandraConverter
convertToColumnType
in interface CassandraConverter
obj
- Object
to convert; must not be null.public Object convertToColumnType(Object value, org.springframework.data.util.TypeInformation<?> typeInformation)
CassandraConverter
convertToColumnType
in interface CassandraConverter
value
- Object
to convert; must not be null.typeInformation
- TypeInformation
used to describe the object type; must not be null.public void write(Object source, Object sink, CassandraPersistentEntity<?> entity)
CassandraConverter
write
in interface CassandraConverter
source
- the source, must not be null.sink
- must not be null.entity
- must not be null.public Object getId(Object object, CassandraPersistentEntity<?> entity)
CassandraConverter
Id
or
PrimaryKey
IdMapId
for composite PrimaryKeyColumn
Id'sPrimaryKey
using a
PrimaryKeyClass
getId
in interface CassandraConverter
object
- must not be null.entity
- must not be null.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.