public <V> void setDynamicComposite(N columnName, DynamicComposite composite) { addInsertion(columnName, composite, DynamicCompositeSerializer.get(), globalTtl); }
ByteBuffer buffer = DynamicCompositeSerializer.get().toByteBuffer(composite); DynamicComposite parsed = DynamicCompositeSerializer.get().fromByteBuffer(buffer);
@Override public Object getInstance(ByteBuffer buffer) { return readDynamicComposite(dynamicSerializer.fromByteBuffer(buffer)); }
@Override public ByteBuffer toByteBuffer(Object oid) { return dynamicSerializer.toByteBuffer(createComposite(((OpenJPAId) oid) .getIdObject())); }
@Override public Object getInstance(byte[] bytes) { return readDynamicComposite(dynamicSerializer.fromBytes(bytes)); }
c.addComponent(phone.getType(), ObjectSerializer.get()); DynamicCompositeSerializer dynamicCompositeSerializer = new DynamicCompositeSerializer();
DynamicComposite composite = serializer.fromByteBuffer(column.getValue());
public <V> void setDynamicComposite(N columnName, DynamicComposite composite, int ttl) { addInsertion(columnName, composite, DynamicCompositeSerializer.get(), ttl); }
DynamicComposite composite = serializer.fromByteBuffer(column.getValue());
serializer = CompositeSerializer.get(); } else if (valueClass.equals(DynamicComposite.class)) { serializer = DynamicCompositeSerializer.get(); } else if (valueClass.equals(Date.class)) { serializer = DateSerializer.get();
/** * Read the field from the query result into the opject within the state * manager. * * @param stateManager * @param result * @return True if the field was loaded. False otherwise */ public boolean readField(OpenJPAStateManager stateManager, QueryResult<ColumnSlice<String, ByteBuffer>> result) { HColumn<String, ByteBuffer> column = result.get().getColumnByName(name); if (column == null) { stateManager.store(fieldId, null); return false; } DynamicComposite composite = serializer.fromByteBuffer(column.getValue()); // The entity itself is embedded read the de-serialized object and set // it's state manager OpenJPAStateManager embeddedSm = stateManager.getContext().embed(null, null, stateManager, embeddedField); stateManager.store(fieldId, embeddedSm.getManagedInstance()); // now load from the composite entityValue.getFromComposite(embeddedSm, composite, 0); return true; }
public <V> void setDynamicComposite(N columnName, DynamicComposite composite, int ttl) { addInsertion(columnName, composite, DynamicCompositeSerializer.get(), ttl); }
public <V> void setDynamicComposite(N columnName, DynamicComposite composite) { addInsertion(columnName, composite, DynamicCompositeSerializer.get(), globalTtl); }
serializer = CompositeSerializer.get(); } else if (value instanceof DynamicComposite) { serializer = DynamicCompositeSerializer.get(); } else if (value instanceof Date) { serializer = DateSerializer.get();
public <V> void setDynamicComposite(N columnName, DynamicComposite composite) { HColumn<N, DynamicComposite> column = columnFactory.createColumn(columnName, composite, clock, template.getTopSerializer(), DynamicCompositeSerializer.get()); }
serializer = CompositeSerializer.get(); } else if (valueClass.equals(DynamicComposite.class)) { serializer = DynamicCompositeSerializer.get(); } else if (valueClass.equals(Date.class)) { serializer = DateSerializer.get();
DynamicCompositeSerializer.get(), ByteBufferSerializer.get()); QueryResult<ColumnSlice<DynamicComposite, ByteBuffer>> result = null;
serializer = CompositeSerializer.get(); } else if (value instanceof DynamicComposite) { serializer = DynamicCompositeSerializer.get(); } else if (value instanceof Date) { serializer = DateSerializer.get();
/** * Generate the given number of composites and returns the key for the row * * @param size */ private ByteBuffer generateComposites(int size) { Mutator<ByteBuffer> mutator = HFactory.createMutator( CassandraTestBase.keyspace, ByteBufferSerializer.get()); ByteBuffer rowKey = generateRowKey(); for (int i = 0; i < size; i++) { DynamicComposite composite = new DynamicComposite(); composite.addComponent(i, IntegerSerializer.get(), IntegerSerializer .get().getComparatorType().getTypeName()); mutator.addInsertion( rowKey, AbstractIndexOperation.CF_NAME, HFactory.createColumn(composite, holder, DynamicCompositeSerializer.get(), ByteBufferSerializer.get())); } mutator.execute(); return rowKey; }
AbstractIndexOperation.CF_NAME, HFactory.createColumn(composite, holder, DynamicCompositeSerializer.get(), ByteBufferSerializer.get())); AbstractIndexOperation.CF_NAME, HFactory.createColumn(composite, holder, DynamicCompositeSerializer.get(), ByteBufferSerializer.get())); DynamicCompositeSerializer.get(), ByteBufferSerializer.get());