/** * Adds a condition to the UPDATE statement this WHERE clause is part of. * * <p>This will configure the statement as non-idempotent, see {@link * com.datastax.driver.core.Statement#isIdempotent()} for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement this WHERE clause is part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
/** * Adds a condition to the UPDATE statement these options are part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement these options are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement those assignments are part of. * * <p>This will configure the statement as non-idempotent, see {@link * com.datastax.driver.core.Statement#isIdempotent()} for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement those assignments are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
private T updateLocked(T entity) { long version = (entity.getVersion() == null) ? 0L : entity.getVersion(); Assignments assigns = update(getColumnFamilyName()) .onlyIf(eq(OPT_LOCK, version)) .with(set(OPT_LOCK, version + 1)); CassandraEntityMapper<T> entityMapper = CassandraEntityMapper.getEntityMapperForClass(
/** * Adds a condition to the UPDATE statement these options are part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement these options are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement these options are part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement these options are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement this WHERE clause is part of. * <p/> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement this WHERE clause is part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
/** * Adds a condition to the UPDATE statement these options are part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement these options are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement those assignments are part of. * <p/> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement those assignments are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
/** * Adds a condition to the UPDATE statement those assignments are part of. * <p/> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement those assignments are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
/** * Adds a condition to the UPDATE statement this WHERE clause is part of. * <p/> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement this WHERE clause is part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
/** * Adds a condition to the UPDATE statement those assignments are part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement those assignments are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement this WHERE clause is part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement this WHERE clause is part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement those assignments are part of. * <p/> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement those assignments are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
/** * Adds a condition to the UPDATE statement these options are part of. * * @param condition the condition to add. * @return the conditions for the UPDATE statement these options are part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); } }
/** * Adds a condition to the UPDATE statement this WHERE clause is part of. * <p/> * This will configure the statement as non-idempotent, see {@link com.datastax.driver.core.Statement#isIdempotent()} * for more information. * * @param condition the condition to add. * @return the conditions for the UPDATE statement this WHERE clause is part of. */ public Conditions onlyIf(Clause condition) { return statement.onlyIf(condition); }
update("foo").onlyIf().and(contains("developers", "datastax")).where(eq("good", "drivers")), update("foo").onlyIf(contains("developers", "datastax")).with(set("v", 0)), update("foo").with(set("v", 0)).onlyIf(contains("hello", "world")), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(now())).ifNotExists(),
newVersion = incVersion(oldVersion); verField.setValue(entity, newVersion); update.onlyIf(eq(verField.getColumnName(), oldVersion));
private PreparedStatement prepareUpdate(Session session) { return session.prepare(update(TABLE_NAME) .onlyIf(eq(NEXT_MODSEQ, bindMarker(MOD_SEQ_CONDITION))) .with(set(NEXT_MODSEQ, bindMarker(NEXT_MODSEQ))) .where(eq(MAILBOX_ID, bindMarker(MAILBOX_ID)))); }
private PreparedStatement prepareUpdate(Session session) { return session.prepare(update(TABLE_NAME) .onlyIf(eq(NEXT_UID, bindMarker(CONDITION))) .with(set(NEXT_UID, bindMarker(NEXT_UID))) .where(eq(MAILBOX_ID, bindMarker(MAILBOX_ID)))); }