/** * Adds the provided option. * * @param using a DELETE option. * @return this {@code Options} object. */ public Options and(Using using) { usings.add(using); checkForBindMarkers(using); return this; }
delete = delete("a", "b", "c").from("foo").using(timestamp(0)).where(eq("k", 1)); assertEquals(delete.toString(), query); delete = delete().all().from("foo").using(timestamp(1240003134L)).where(eq("k", "value")); assertEquals(delete.toString(), query); delete = delete().from("foo").using(timestamp(1240003134L)).where(eq("k", "value")); assertEquals(delete.toString(), query);
delete = delete("a", "b", "c").from("baz", "foo").using(timestamp(0)).where(eq("k", 1)); assertEquals(delete.toString(), query); assertThat(delete.getKeyspace()).isEqualTo("baz"); // keyspace set since provided. delete = delete().all().from("foo").using(timestamp(1240003134L)).where(eq("k", "value")); assertEquals(delete.toString(), query); delete = delete().from("foo").using(timestamp(1240003134L)).where(eq("k", "value")); assertEquals(delete.toString(), query);
Delete(String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
Delete(String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
Delete(String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
Delete(TableMetadata table, List<Object> columnNames) { super(table); this.table = escapeId(table.getName()); this.columnNames = columnNames; this.where = new Where(this); this.usings = new Options(this); }
Delete(String keyspace, String table, List<Object> columnNames) { super(keyspace); this.table = table; this.columnNames = columnNames; this.where = new Where(this); this.usings = new Options(this); }
@Override void modifyQueryString(BuiltStatement query) { if (query instanceof Insert) { ((Insert) query).using().and(QueryBuilder.timestamp(QueryBuilder.bindMarker())); } else if (query instanceof Delete) { ((Delete) query).using().and(QueryBuilder.timestamp(QueryBuilder.bindMarker())); } else { throw new AssertionError("Unexpected query type: " + query.getClass()); } }
/** * Adds a new options for this DELETE statement. * * @param using the option to add. * @return the options of this DELETE statement. */ public Options using(Using using) { return usings.and(using); }
/** * Adds the provided option. * * @param using a DELETE option. * @return this {@code Options} object. */ public Options and(Using using) { usings.add(using); checkForBindMarkers(using); return this; }
/** * Adds the provided option. * * @param using a DELETE option. * @return this {@code Options} object. */ public Options and(Using using) { usings.add(using); checkForBindMarkers(using); return this; }
/** * Adds a new options for this DELETE statement. * * @param using the option to add. * @return the options of this DELETE statement. */ public Options using(Using using) { return usings.and(using); }
/** * Adds the provided option. * * @param using a DELETE option. * @return this {@code Options} object. */ public Options and(Using using) { usings.add(using); checkForBindMarkers(using); return this; }
/** * Adds a new options for this DELETE statement. * * @param using the option to add. * @return the options of this DELETE statement. */ public Options using(Using using) { return usings.and(using); }
/** * Adds a new options for this DELETE statement. * * @param using the option to add. * @return the options of this DELETE statement. */ public Options using(Using using) { return usings.and(using); }
Delete( String keyspace, String table, List<Object> routingKeyValues, List<ColumnMetadata> partitionKey, List<Selector> columns) { super(keyspace, partitionKey, routingKeyValues); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); // This is for JAVA-1089, if the query deletes an element in a list, the statement should be // non-idempotent. if (!areIdempotent(columns)) { setNonIdempotentOps(); } }
/** * Adds the provided option. * * @param using a DELETE option. * @return this {@code Options} object. */ public Options and(Using using) { usings.add(using); checkForBindMarkers(using); return this; }
/** * Adds a new options for this DELETE statement. * * @param using the option to add. * @return the options of this DELETE statement. */ public Options using(Using using) { return usings.and(using); }