/** * Discard a value from a list column. * * <p>This will generate: {@code name = name - [value]}. * * @param name the column name (must be of type list). * @param value the value to discard. Using a BindMarker here is not supported. To use a * BindMarker use {@code QueryBuilder#discardAll} with a singleton list. * @return the correspond assignment (to use in an update query) */ public static Assignment discard(String name, Object value) { if (value instanceof BindMarker) { throw new InvalidQueryException( "Binding a value in discard() is not supported, use discardAll() and bind a singleton list"); } return discardAll(name, Collections.singletonList(value)); }
/** * Generate an UPDATE FROM ... <strong>SET listUdt = listUdt - [?]</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexTypes_Update.Cols RemoveFrom(final TestUDT listUdt_element) { where.with(QueryBuilder.discardAll("list_udt", QueryBuilder.bindMarker("list_udt"))); boundValues.add(Arrays.asList(listUdt_element)); encodedValues.add(meta.listUdt.encodeFromJava(Arrays.asList(listUdt_element), Optional.of(cassandraOptions))); return EntityWithComplexTypes_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET doubleList = doubleList - [?]</strong> */ @SuppressWarnings("static-access") public final EntityWithNativeCollections_Update.Cols RemoveFrom(final Double doubleList_element) { where.with(QueryBuilder.discardAll("doublelist", QueryBuilder.bindMarker("doublelist"))); boundValues.add(Arrays.asList(doubleList_element)); encodedValues.add(meta.doubleList.encodeFromJava(Arrays.asList(doubleList_element), Optional.of(cassandraOptions))); return EntityWithNativeCollections_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET list = list - [?]</strong> */ @SuppressWarnings("static-access") public final EntityWithBeanValidation_Update.Cols RemoveFrom(final String list_element) { where.with(QueryBuilder.discardAll("list", QueryBuilder.bindMarker("list"))); boundValues.add(Arrays.asList(list_element)); encodedValues.add(meta.list.encodeFromJava(Arrays.asList(list_element), Optional.of(cassandraOptions))); return EntityWithBeanValidation_Update.Cols.this; }
update = update("foo") .with(discardAll("b", Arrays.asList(1, 2, 3))) .and(add("c", 1)) .and(
/** * Generate an UPDATE FROM ... <strong>SET collectionIndex = collectionIndex - [?]</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexIndices_Update.Cols RemoveFrom(final String collectionIndex_element) { where.with(QueryBuilder.discardAll("collectionindex", QueryBuilder.bindMarker("collectionindex"))); boundValues.add(Arrays.asList(collectionIndex_element)); encodedValues.add(meta.collectionIndex.encodeFromJava(Arrays.asList(collectionIndex_element), Optional.of(cassandraOptions))); return new EntityWithComplexIndices_Update.Cols(where, cassandraOptions); }
/** * Generate an UPDATE FROM ... <strong>SET listOfLongArray = listOfLongArray - [?]</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexTypes_Update.Cols RemoveFrom(final long[] listOfLongArray_element) { where.with(QueryBuilder.discardAll("listoflongarray", QueryBuilder.bindMarker("listoflongarray"))); boundValues.add(Arrays.asList(listOfLongArray_element)); encodedValues.add(meta.listOfLongArray.encodeFromJava(Arrays.asList(listOfLongArray_element), Optional.of(cassandraOptions))); return new EntityWithComplexTypes_Update.Cols(where, cassandraOptions); }
@Override public UpdateBuilder<T> removeListAll(String name, List<?> list) { update.with(QueryBuilder.discardAll(classBean.toColumn(name), list)); return this; } @Override
/** * Generate an UPDATE FROM ... <strong>SET udtList = udtList - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithUDTForDynamicKeyspace_Update.Cols RemoveAllFrom(final List<UDTWithNoKeyspace> udtList_element) { where.with(QueryBuilder.discardAll("udtlist", QueryBuilder.bindMarker("udtlist"))); boundValues.add(udtList_element); encodedValues.add(meta.udtList.encodeFromJava(udtList_element, Optional.of(cassandraOptions))); return EntityWithUDTForDynamicKeyspace_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET collectionIndex = collectionIndex - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexIndices_Update.Cols RemoveAllFrom(final List<String> collectionIndex_element) { where.with(QueryBuilder.discardAll("collectionindex", QueryBuilder.bindMarker("collectionindex"))); boundValues.add(collectionIndex_element); encodedValues.add(meta.collectionIndex.encodeFromJava(collectionIndex_element, Optional.of(cassandraOptions))); return EntityWithComplexIndices_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET listOfOptional = listOfOptional - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexTypes_Update.Cols RemoveAllFrom(final List<Optional<String>> listOfOptional_element) { where.with(QueryBuilder.discardAll("listofoptional", QueryBuilder.bindMarker("listofoptional"))); boundValues.add(listOfOptional_element); encodedValues.add(meta.listOfOptional.encodeFromJava(listOfOptional_element, Optional.of(cassandraOptions))); return EntityWithComplexTypes_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET list = list - [?]</strong> */ @SuppressWarnings("static-access") public final EntityWithCaseSensitivePK_Update.Cols RemoveFrom(final String list_element) { where.with(QueryBuilder.discardAll("\"listString\"", QueryBuilder.bindMarker("\"listString\""))); boundValues.add(Arrays.asList(list_element)); encodedValues.add(meta.list.encodeFromJava(Arrays.asList(list_element), Optional.of(cassandraOptions))); return new EntityWithCaseSensitivePK_Update.Cols(where, cassandraOptions); }
/** * Generate an UPDATE FROM ... <strong>SET listString = listString - [?]</strong> */ @SuppressWarnings("static-access") public final EntityForJSONCall_Update.Cols RemoveFrom(final String listString_element) { where.with(QueryBuilder.discardAll("liststring", QueryBuilder.bindMarker("liststring"))); boundValues.add(Arrays.asList(listString_element)); encodedValues.add(meta.listString.encodeFromJava(Arrays.asList(listString_element), Optional.of(cassandraOptions))); return new EntityForJSONCall_Update.Cols(where, cassandraOptions); }
/** * Generate an UPDATE FROM ... <strong>SET consistencyList = consistencyList - [?]</strong> */ @SuppressWarnings("static-access") public final SimpleEntity_Update.Cols RemoveFrom(final ConsistencyLevel consistencyList_element) { where.with(QueryBuilder.discardAll("consistencylist", QueryBuilder.bindMarker("consistencylist"))); boundValues.add(Arrays.asList(consistencyList_element)); encodedValues.add(meta.consistencyList.encodeFromJava(Arrays.asList(consistencyList_element), Optional.of(cassandraOptions))); return new SimpleEntity_Update.Cols(where, cassandraOptions); }
/** * Generate an UPDATE FROM ... <strong>SET list = list - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithCaseSensitivePK_Update.Cols RemoveAllFrom(final java.util.List<String> list_element) { where.with(QueryBuilder.discardAll("\"listString\"", QueryBuilder.bindMarker("\"listString\""))); boundValues.add(list_element); encodedValues.add(meta.list.encodeFromJava(list_element, Optional.of(cassandraOptions))); return EntityWithCaseSensitivePK_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET collectionIndex = collectionIndex - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithIndicesForJSON_Update.Cols RemoveAllFrom(final List<String> collectionIndex_element) { where.with(QueryBuilder.discardAll("collectionindex", QueryBuilder.bindMarker("collectionindex"))); boundValues.add(collectionIndex_element); encodedValues.add(meta.collectionIndex.encodeFromJava(collectionIndex_element, Optional.of(cassandraOptions))); return EntityWithIndicesForJSON_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET listUdt = listUdt - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexTypes_Update.Cols RemoveAllFrom(final List<TestUDT> listUdt_element) { where.with(QueryBuilder.discardAll("list_udt", QueryBuilder.bindMarker("list_udt"))); boundValues.add(listUdt_element); encodedValues.add(meta.listUdt.encodeFromJava(listUdt_element, Optional.of(cassandraOptions))); return EntityWithComplexTypes_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET listNesting = listNesting - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithComplexTypes_Update.Cols RemoveAllFrom(final List<Map<java.lang.Integer, String>> listNesting_element) { where.with(QueryBuilder.discardAll("list_nesting", QueryBuilder.bindMarker("list_nesting"))); boundValues.add(listNesting_element); encodedValues.add(meta.listNesting.encodeFromJava(listNesting_element, Optional.of(cassandraOptions))); return EntityWithComplexTypes_Update.Cols.this; }
/** * Generate an UPDATE FROM ... <strong>SET list = list - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithBeanValidation_Update.Cols RemoveAllFrom(final java.util.List<String> list_element) { where.with(QueryBuilder.discardAll("list", QueryBuilder.bindMarker("list"))); boundValues.add(list_element); encodedValues.add(meta.list.encodeFromJava(list_element, Optional.of(cassandraOptions))); return new EntityWithBeanValidation_Update.Cols(where, cassandraOptions); }
/** * Generate an UPDATE FROM ... <strong>SET collectionIndex = collectionIndex - ?</strong> */ @SuppressWarnings("static-access") public final EntityWithIndicesForJSON_Update.Cols RemoveAllFrom(final List<String> collectionIndex_element) { where.with(QueryBuilder.discardAll("collectionindex", QueryBuilder.bindMarker("collectionindex"))); boundValues.add(collectionIndex_element); encodedValues.add(meta.collectionIndex.encodeFromJava(collectionIndex_element, Optional.of(cassandraOptions))); return new EntityWithIndicesForJSON_Update.Cols(where, cassandraOptions); }