public ParsedStatement.Prepared prepare() throws InvalidRequestException { VariableSpecifications boundNames = getBoundVariables(); List<ModificationStatement> statements = new ArrayList<>(parsedStatements.size()); for (ModificationStatement.Parsed parsed : parsedStatements) statements.add(parsed.prepare(boundNames)); Attributes prepAttrs = attrs.prepare("[batch]", "[batch]"); prepAttrs.collectMarkerSpecification(boundNames); BatchStatement batchStatement = new BatchStatement(boundNames.size(), type, statements, prepAttrs); batchStatement.validate(); return new ParsedStatement.Prepared(batchStatement, boundNames); } }
prepAttrs.collectMarkerSpecification(boundNames); BatchStatement batchStatement = new BatchStatement(boundNames.size(), type, statements, prepAttrs); batchStatement.validate();
prepAttrs.collectMarkerSpecification(boundNames); BatchStatement batchStatement = new BatchStatement(boundNames.size(), type, statements, prepAttrs); batchStatement.validate();
prepAttrs.collectMarkerSpecification(boundNames); BatchStatement batchStatement = new BatchStatement(boundNames.size(), type, statements, prepAttrs); batchStatement.validate();
protected ModificationStatement prepareInternal(CFMetaData cfm, VariableSpecifications boundNames, Attributes attrs) throws InvalidRequestException UpdateStatement stmt = new UpdateStatement(ModificationStatement.StatementType.INSERT,boundNames.size(), cfm, attrs);
protected ModificationStatement prepareInternal(CFMetaData cfm, VariableSpecifications boundNames, Attributes attrs) throws InvalidRequestException { UpdateStatement stmt = new UpdateStatement(ModificationStatement.StatementType.UPDATE, boundNames.size(), cfm, attrs); for (Pair<ColumnIdentifier.Raw, Operation.RawUpdate> entry : updates) { ColumnDefinition def = cfm.getColumnDefinition(entry.left.prepare(cfm)); if (def == null) throw new InvalidRequestException(String.format("Unknown identifier %s", entry.left)); Operation operation = entry.right.prepare(keyspace(), def); operation.collectMarkerSpecification(boundNames); switch (def.kind) { case PARTITION_KEY: case CLUSTERING_COLUMN: throw new InvalidRequestException(String.format("PRIMARY KEY part %s found in SET part", entry.left)); default: stmt.addOperation(operation); break; } } stmt.processWhereClause(whereClause, boundNames); return stmt; } }
protected ModificationStatement prepareInternal(CFMetaData cfm, VariableSpecifications boundNames, Attributes attrs) throws InvalidRequestException { DeleteStatement stmt = new DeleteStatement(ModificationStatement.StatementType.DELETE, boundNames.size(), cfm, attrs); for (Operation.RawDeletion deletion : deletions) { ColumnIdentifier id = deletion.affectedColumn().prepare(cfm); ColumnDefinition def = cfm.getColumnDefinition(id); if (def == null) throw new InvalidRequestException(String.format("Unknown identifier %s", id)); // For compact, we only have one value except the key, so the only form of DELETE that make sense is without a column // list. However, we support having the value name for coherence with the static/sparse case if (def.isPrimaryKeyColumn()) throw new InvalidRequestException(String.format("Invalid identifier %s for deletion (should not be a PRIMARY KEY part)", def.name)); Operation op = deletion.prepare(cfm.ksName, def); op.collectMarkerSpecification(boundNames); stmt.addOperation(op); } stmt.processWhereClause(whereClause, boundNames); return stmt; } }
boundNames.size(), cfm, operations,
boundNames.size(), parameters, selection,
boundNames.size(), parameters, selection,
boundNames.size(), cfm, operations,
boundNames.size(), parameters, selection,
boundNames.size(), cfm, operations,
boundNames.size(), cfm, operations,
boundNames.size(), cfm, operations,
boundNames.size(), cfm, operations,
conditions); DeleteStatement stmt = new DeleteStatement(boundNames.size(), cfm, operations,
conditions); DeleteStatement stmt = new DeleteStatement(boundNames.size(), cfm, operations,
conditions); DeleteStatement stmt = new DeleteStatement(boundNames.size(), cfm, operations,
boundNames.size(), cfm, operations,