public static ByteBuffer asBytes(String keyspace, String term, AbstractType type) { ColumnSpecification receiver = new ColumnSpecification(keyspace, "--dummy--", new ColumnIdentifier("(dummy)", true), type); Term.Raw rawTerm = CQLFragmentParser.parseAny(CqlParser::term, term, "CQL term"); return rawTerm.prepare(keyspace, receiver).bindAndGet(QueryOptions.DEFAULT); } }
public ColumnCondition.Bound bind(QueryOptions options) throws InvalidRequestException { boolean isInCondition = operator.equals(Operator.IN); if (column.type instanceof CollectionType) { if (collectionElement == null) return isInCondition ? new CollectionInBound(this, options) : new CollectionBound(this, options); else return isInCondition ? new ElementAccessInBound(this, options) : new ElementAccessBound(this, options); } return isInCondition ? new SimpleInBound(this, options) : new SimpleBound(this, options); }
public Attributes prepare(String ksName, String cfName) throws InvalidRequestException { Term ts = timestamp == null ? null : timestamp.prepare(ksName, timestampReceiver(ksName, cfName)); Term ttl = timeToLive == null ? null : timeToLive.prepare(ksName, timeToLiveReceiver(ksName, cfName)); return new Attributes(ts, ttl); }
public static UntypedResultSet executeInternal(String query, Object... values) { ParsedStatement.Prepared prepared = prepareInternal(query); ResultMessage result = prepared.statement.executeInternal(internalQueryState(), makeInternalOptions(prepared, values)); if (result instanceof ResultMessage.Rows) return UntypedResultSet.create(((ResultMessage.Rows)result).result); else return null; }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { assert receiver.type instanceof MapType; Term k = selector.prepare(cfm.ksName, Maps.keySpecOf(receiver)); Term v = value.prepare(cfm.ksName, Maps.valueSpecOf(receiver)); return new Maps.AdderByKey(receiver, v, k); }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { assert receiver.type instanceof MapType; Term k = selector.prepare(cfm.ksName, Maps.keySpecOf(receiver)); Term v = value.prepare(cfm.ksName, Maps.valueSpecOf(receiver)); return new Maps.SubtracterByKey(receiver, v, k); }
public ByteBuffer bindAndGet(QueryOptions options) throws InvalidRequestException { Terminal t = bind(options); return t == null ? null : t.get(options.getProtocolVersion()); } }
public void prepareValue(CFMetaData cfm, AbstractType<?> expressionType, VariableSpecifications boundNames) { ColumnSpecification spec = new ColumnSpecification(cfm.ksName, cfm.ksName, valueColId, expressionType); value = valueRaw.prepare(cfm.ksName, spec); value.collectMarkerSpecification(boundNames); }
public Prepared prepareAndCollectMarkers(CFMetaData metadata, Collection<ColumnDefinition> receivers, VariableSpecifications boundNames) { boundNames.add(bindIndex, makeReceiver(metadata)); return new PreparedMarker(bindIndex, receivers); }
/** * Checks that the specified operations and conditions only apply to static columns. * @return <code>true</code> if the specified operations and conditions only apply to static columns, * <code>false</code> otherwise. */ public static boolean appliesOnlyToStaticColumns(Operations operation, Conditions conditions) { return !operation.appliesToRegularColumns() && !conditions.appliesToRegularColumns() && (operation.appliesToStaticColumns() || conditions.appliesToStaticColumns()); }
String name = fieldNames.get(i).toString(); // JPA name,
public static ByteBuffer asBytes(String keyspace, String term, AbstractType type) { ColumnSpecification receiver = new ColumnSpecification(keyspace, "--dummy--", new ColumnIdentifier("(dummy)", true), type); Term.Raw rawTerm = CQLFragmentParser.parseAny(CqlParser::term, term, "CQL term"); return rawTerm.prepare(keyspace, receiver).bindAndGet(QueryOptions.DEFAULT); } }
public static UntypedResultSet executeInternal(String query, Object... values) { ParsedStatement.Prepared prepared = prepareInternal(query); ResultMessage result = prepared.statement.executeInternal(internalQueryState(), makeInternalOptions(prepared, values)); if (result instanceof ResultMessage.Rows) return UntypedResultSet.create(((ResultMessage.Rows)result).result); else return null; }
public Attributes prepare(String ksName, String cfName) throws InvalidRequestException { Term ts = timestamp == null ? null : timestamp.prepare(ksName, timestampReceiver(ksName, cfName)); Term ttl = timeToLive == null ? null : timeToLive.prepare(ksName, timeToLiveReceiver(ksName, cfName)); return new Attributes(ts, ttl); }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { assert receiver.type instanceof MapType; Term k = selector.prepare(cfm.ksName, Maps.keySpecOf(receiver)); Term v = value.prepare(cfm.ksName, Maps.valueSpecOf(receiver)); return new Maps.AdderByKey(receiver, v, k); }
public Operation prepare(CFMetaData cfm, ColumnDefinition receiver) throws InvalidRequestException { assert receiver.type instanceof MapType; Term k = selector.prepare(cfm.ksName, Maps.keySpecOf(receiver)); Term v = value.prepare(cfm.ksName, Maps.valueSpecOf(receiver)); return new Maps.SubtracterByKey(receiver, v, k); }
public ByteBuffer bindAndGet(QueryOptions options) throws InvalidRequestException { Terminal t = bind(options); return t == null ? null : t.get(options.getProtocolVersion()); } }
public void prepareValue(CFMetaData cfm, AbstractType<?> expressionType, VariableSpecifications boundNames) { ColumnSpecification spec = new ColumnSpecification(cfm.ksName, cfm.ksName, valueColId, expressionType); value = valueRaw.prepare(cfm.ksName, spec); value.collectMarkerSpecification(boundNames); }
public Prepared prepareAndCollectMarkers(CFMetaData metadata, Collection<ColumnDefinition> receivers, VariableSpecifications boundNames) { boundNames.add(bindIndex, makeReceiver(metadata)); return new PreparedMarker(bindIndex, receivers); }
public static ByteBuffer asBytes(String keyspace, String term, AbstractType type) { ColumnSpecification receiver = new ColumnSpecification(keyspace, "--dummy--", new ColumnIdentifier("(dummy)", true), type); Term.Raw rawTerm = CQLFragmentParser.parseAny(CqlParser::term, term, "CQL term"); return rawTerm.prepare(keyspace, receiver).bindAndGet(QueryOptions.DEFAULT); } }