public class MappingCassandraConverter extends AbstractCassandraConverter implements CassandraConverter, ApplicationContextAware, 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,
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() |
protected Object |
getReadValue(CassandraValueProvider row,
CassandraPersistentProperty property)
Retrieve the value to read for the given
CassandraPersistentProperty from
BasicCassandraRowValueProvider and perform optionally a conversion of collection element types. |
protected Object |
instantiatePrimaryKey(CassandraPersistentEntity<?> entity,
CassandraPersistentProperty keyProperty,
CassandraValueProvider propertyProvider) |
<R> R |
read(Class<R> type,
Object row) |
protected <S> S |
readEntityFromRow(CassandraPersistentEntity<S> entity,
com.datastax.driver.core.Row row) |
protected <S> S |
readEntityFromUdt(CassandraPersistentEntity<S> entity,
com.datastax.driver.core.UDTValue udtValue) |
protected void |
readProperties(CassandraPersistentEntity<?> entity,
CassandraValueProvider valueProvider,
PersistentPropertyAccessor propertyAccessor) |
protected void |
readPropertiesFromRow(CassandraPersistentEntity<?> entity,
CassandraRowValueProvider row,
PersistentPropertyAccessor propertyAccessor) |
protected void |
readProperty(CassandraPersistentEntity<?> entity,
CassandraPersistentProperty property,
CassandraValueProvider valueProvider,
PersistentPropertyAccessor propertyAccessor) |
<R> R |
readRow(Class<R> type,
com.datastax.driver.core.Row row)
Read a
Row into the requested target type. |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
write(Object source,
Object sink) |
void |
write(Object source,
Object sink,
CassandraPersistentEntity<?> entity)
|
protected void |
writeDeleteWhereFromObject(Object object,
com.datastax.driver.core.querybuilder.Delete.Where where,
CassandraPersistentEntity<?> entity) |
protected void |
writeInsertFromWrapper(ConvertingPropertyAccessor accessor,
com.datastax.driver.core.querybuilder.Insert insert,
CassandraPersistentEntity<?> entity) |
protected void |
writeSelectWhereFromObject(Object object,
com.datastax.driver.core.querybuilder.Select.Where where,
CassandraPersistentEntity<?> entity) |
protected void |
writeUDTValueWhereFromObject(ConvertingPropertyAccessor accessor,
com.datastax.driver.core.UDTValue udtValue,
CassandraPersistentEntity<?> entity) |
protected void |
writeUpdateFromObject(Object object,
com.datastax.driver.core.querybuilder.Update update,
CassandraPersistentEntity<?> entity) |
protected void |
writeUpdateFromWrapper(ConvertingPropertyAccessor accessor,
com.datastax.driver.core.querybuilder.Update update,
CassandraPersistentEntity<?> entity) |
afterPropertiesSet, getConversionService, getCustomConversions, setCustomConversions, setInstantiatorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCustomConversionsgetConversionServicepublic MappingCassandraConverter()
MappingCassandraConverter with a CassandraMappingContext.public MappingCassandraConverter(CassandraMappingContext mappingContext)
MappingCassandraConverter with the given CassandraMappingContext.mappingContext - must not be null.public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionpublic void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader in interface BeanClassLoaderAwarepublic CassandraMappingContext getMappingContext()
getMappingContext in interface CassandraConvertergetMappingContext in interface 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.protected <S> S readEntityFromRow(CassandraPersistentEntity<S> entity, com.datastax.driver.core.Row row)
protected <S> S readEntityFromUdt(CassandraPersistentEntity<S> entity, com.datastax.driver.core.UDTValue udtValue)
protected void readPropertiesFromRow(CassandraPersistentEntity<?> entity, CassandraRowValueProvider row, PersistentPropertyAccessor propertyAccessor)
protected void readProperties(CassandraPersistentEntity<?> entity, CassandraValueProvider valueProvider, PersistentPropertyAccessor propertyAccessor)
protected void readProperty(CassandraPersistentEntity<?> entity, CassandraPersistentProperty property, CassandraValueProvider valueProvider, PersistentPropertyAccessor propertyAccessor)
protected Object instantiatePrimaryKey(CassandraPersistentEntity<?> entity, CassandraPersistentProperty keyProperty, CassandraValueProvider propertyProvider)
public <R> R read(Class<R> type, Object row)
read in interface EntityReader<Object,Object>public Object convertToColumnType(Object obj)
CassandraConverterconvertToColumnType in interface CassandraConverterobj - Object to convert; must not be null.public Object convertToColumnType(Object value, TypeInformation<?> typeInformation)
CassandraConverterconvertToColumnType in interface CassandraConvertervalue - 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)
write in interface EntityWriter<Object,Object>public void write(Object source, Object sink, CassandraPersistentEntity<?> entity)
CassandraConverterwrite in interface CassandraConvertersource - the source, must not be null.sink - must not be null.entity - must not be null.protected void writeInsertFromWrapper(ConvertingPropertyAccessor accessor, com.datastax.driver.core.querybuilder.Insert insert, CassandraPersistentEntity<?> entity)
protected void writeUpdateFromObject(Object object, com.datastax.driver.core.querybuilder.Update update, CassandraPersistentEntity<?> entity)
protected void writeUpdateFromWrapper(ConvertingPropertyAccessor accessor, com.datastax.driver.core.querybuilder.Update update, CassandraPersistentEntity<?> entity)
protected void writeSelectWhereFromObject(Object object, com.datastax.driver.core.querybuilder.Select.Where where, CassandraPersistentEntity<?> entity)
protected void writeDeleteWhereFromObject(Object object, com.datastax.driver.core.querybuilder.Delete.Where where, CassandraPersistentEntity<?> entity)
protected void writeUDTValueWhereFromObject(ConvertingPropertyAccessor accessor, com.datastax.driver.core.UDTValue udtValue, CassandraPersistentEntity<?> entity)
public Object getId(Object object, CassandraPersistentEntity<?> entity)
CassandraConverterId or
PrimaryKey IdMapId for composite PrimaryKeyColumn
Id'sPrimaryKey using a
PrimaryKeyClassgetId in interface CassandraConverterobject - must not be null.entity - must not be null.@Nullable protected Object getReadValue(CassandraValueProvider row, CassandraPersistentProperty property)
CassandraPersistentProperty from
BasicCassandraRowValueProvider and perform optionally a conversion of collection element types.row - the row.property - the property.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.