に1つのレコードのみを挿入している私は、DataStaxのJavaドライバーバッチがカサンドラ
ここ PreparedStatement pstmt = cqlSession.prepare("INSERT INTO ks_mobapp.messages(pair_id, date, belong_to, message_id, text, sender) VALUES(?, ?, ?, ?, ?, ?);");
BoundStatement boundStatement = new BoundStatement(pstmt);
BatchStatement batchStmt = new BatchStatement();
batchStmt.add(boundStatement.bind(pair, formatDate, pairSplit[0], obj.getLong("time"), text, sndrId));
batchStmt.add(boundStatement.bind(pair, formatDate, pairSplit[1], obj.getLong("time"), text, sndrId));
cqlSession.execute(batchStmt);
pairSplit[0]
& pairSplit[1]
を使用してこのコードを持っている異なっているが、最後に一つだけの行が挿入されます。
彼女は、私が彼らのサンプルのデモを見
CREATE TABLE messages (
pair_id text,
date text,
message_id bigint,
text text,
sender text,
belong_to text,
PRIMARY KEY((pair_id, date, belong_to), message_id)
);