public abstract class CassandraDataHandlerBase extends Object
| Modifier and Type | Field and Description |
|---|---|
protected TimestampGenerator |
generator
The generator.
|
protected EntityManagerFactoryImpl.KunderaMetadata |
kunderaMetadata
The kundera metadata.
|
protected ThriftDataResultHelper |
thriftTranslator
The thrift translator.
|
| Constructor and Description |
|---|
CassandraDataHandlerBase(CassandraClientBase clientBase,
EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata,
TimestampGenerator generator)
Instantiates a new cassandra data handler base.
|
| Modifier and Type | Method and Description |
|---|---|
List<Object> |
fromThriftRow(Class<?> clazz,
EntityMetadata m,
List<String> relationNames,
boolean isWrapReq,
org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel,
Object... rowIds)
From thrift row.
|
abstract Object |
fromThriftRow(Class<?> clazz,
EntityMetadata m,
Object rowKey,
List<String> relationNames,
boolean isWrapReq,
org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel)
From thrift row.
|
<E> E |
fromThriftRow(Class<E> clazz,
EntityMetadata m,
DataRow<org.apache.cassandra.thrift.SuperColumn> tr)
From thrift row.
|
<E> List<Object> |
getForeignKeysFromJoinTable(String inverseJoinColumnName,
List<org.apache.cassandra.thrift.Column> columns,
Class columnJavaType)
Gets the foreign keys from join table.
|
protected byte[] |
getThriftColumnValue(Object e,
javax.persistence.metamodel.Attribute attribute)
Gets the thrift column value.
|
Object |
populateEmbeddedRecursive(ByteBuffer value,
List<org.apache.cassandra.db.marshal.AbstractType<?>> types,
List<ByteBuffer> fieldNames,
Object entity,
MetamodelImpl metaModel)
Populate embedded recursive.
|
Object |
populateEntity(ThriftRow tr,
EntityMetadata m,
Object entity,
List<String> relationNames,
boolean isWrapReq)
Populate entity.
|
List<ThriftRow> |
toIndexThriftRow(Object e,
EntityMetadata m,
String columnFamily)
To index thrift row.
|
Collection<ThriftRow> |
toThriftRow(Object e,
Object id,
EntityMetadata m,
String columnFamily,
Object columnTTLs)
Helper method to convert @Entity to ThriftRow.
|
protected final ThriftDataResultHelper thriftTranslator
protected final EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata
protected final TimestampGenerator generator
public CassandraDataHandlerBase(CassandraClientBase clientBase, EntityManagerFactoryImpl.KunderaMetadata kunderaMetadata, TimestampGenerator generator)
clientBase - the client basekunderaMetadata - the kundera metadatagenerator - the generatorpublic <E> E fromThriftRow(Class<E> clazz, EntityMetadata m, DataRow<org.apache.cassandra.thrift.SuperColumn> tr) throws Exception
E - the element typeclazz - the clazzm - the mtr - the crException - the exceptionpublic List<Object> fromThriftRow(Class<?> clazz, EntityMetadata m, List<String> relationNames, boolean isWrapReq, org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel, Object... rowIds) throws Exception
clazz - the clazzm - the mrelationNames - the relation namesisWrapReq - the is wrap reqconsistencyLevel - the consistency levelrowIds - the row idsException - the exceptionpublic abstract Object fromThriftRow(Class<?> clazz, EntityMetadata m, Object rowKey, List<String> relationNames, boolean isWrapReq, org.apache.cassandra.thrift.ConsistencyLevel consistencyLevel) throws Exception
clazz - the clazzm - the mrowKey - the row keyrelationNames - the relation namesisWrapReq - the is wrap reqconsistencyLevel - the consistency levelException - the exceptionpublic Collection<ThriftRow> toThriftRow(Object e, Object id, EntityMetadata m, String columnFamily, Object columnTTLs) throws Exception
e - the eid - the idm - the mcolumnFamily - the colmun familycolumnTTLs - TODOException - the exceptionpublic List<ThriftRow> toIndexThriftRow(Object e, EntityMetadata m, String columnFamily)
e - the em - the mcolumnFamily - the column familypublic <E> List<Object> getForeignKeysFromJoinTable(String inverseJoinColumnName, List<org.apache.cassandra.thrift.Column> columns, Class columnJavaType)
E - the element typeinverseJoinColumnName - the inverse join column namecolumns - the columnscolumnJavaType - the column java typepublic Object populateEntity(ThriftRow tr, EntityMetadata m, Object entity, List<String> relationNames, boolean isWrapReq)
tr - the trm - the mentity - the entityrelationNames - the relation namesisWrapReq - the is wrap reqpublic Object populateEmbeddedRecursive(ByteBuffer value, List<org.apache.cassandra.db.marshal.AbstractType<?>> types, List<ByteBuffer> fieldNames, Object entity, MetamodelImpl metaModel)
value - the valuetypes - the typesfieldNames - the field namesentity - the entitymetaModel - the meta modelprotected byte[] getThriftColumnValue(Object e, javax.persistence.metamodel.Attribute attribute)
e - the eattribute - the attributeCopyright © 2016. All Rights Reserved.