byte[] value = column.getPrimaryKey();
try {
Object keyObject = null;
if (key != null) {
PreparedStatement statement = session.prepare("INSERT INTO " + keys + "." + table + "(id, colname, colvalue) VALUES (?, ?, ?)");
BoundStatement boundStatement = new BoundStatement(statement);
if (indexCfName.equalsIgnoreCase("StringIndice")) {
keyObject = StandardConverters.convertFromBytes(String.class, key);
} else if (indexCfName.equalsIgnoreCase("IntegerIndice")) {
keyObject = StandardConverters.convertFromBytes(Long.class, key);
} else if (indexCfName.equalsIgnoreCase("DecimalIndice")) {
keyObject = StandardConverters.convertFromBytes(Float.class, key);
}
session.execute(boundStatement.bind(StandardConverters.convertFromBytes(String.class, rowKey), keyObject, ByteBuffer.wrap(value)));
} else {
PreparedStatement statement = session.prepare("INSERT INTO " + keys + "." + table + "(id, colname, colvalue) VALUES (?, ?, ?)");
BoundStatement boundStatement = new BoundStatement(statement);
if (indexCfName.equalsIgnoreCase("IntegerIndice")) {
boundStatement.setString("id", StandardConverters.convertFromBytes(String.class, rowKey));
boundStatement.setBytesUnsafe("colname", ByteBuffer.wrap(new byte[0]));
boundStatement.setBytes("colvalue", ByteBuffer.wrap(value));