Java Code Examples for com.datastax.driver.core.querybuilder.Delete#Where

The following examples show how to use com.datastax.driver.core.querybuilder.Delete#Where . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConditionSetter.java    From scalardb with Apache License 2.0 5 votes vote down vote up
/**
 * Adds {@code DeleteIf}-specific conditions to the statement
 *
 * @param condition {@code DeleteIf} condition
 */
@Override
public void visit(DeleteIf condition) {
  Delete.Where delete = (Delete.Where) statement;

  List<ConditionalExpression> expressions = condition.getExpressions();
  Delete.Conditions cond = delete.onlyIf(createClauseWith(expressions.get(0)));
  IntStream.range(1, expressions.size())
      .forEach(
          i -> {
            cond.and(createClauseWith(expressions.get(i)));
          });
}
 
Example 2
Source File: ConditionSetter.java    From scalardb with Apache License 2.0 4 votes vote down vote up
/**
 * Adds {@code DeleteIfExists}-specific conditions to the statement
 *
 * @param condition {@code DeleteIfExists} condition
 */
@Override
public void visit(DeleteIfExists condition) {
  Delete.Where delete = (Delete.Where) statement;
  delete.ifExists();
}
 
Example 3
Source File: CassandraPerDomainMaxQuotaDao.java    From james-project with Apache License 2.0 4 votes vote down vote up
private Delete.Where removeMaxMessageStatement() {
    return delete().column(CassandraDomainMaxQuota.MESSAGE_COUNT)
        .from(CassandraDomainMaxQuota.TABLE_NAME)
        .where(eq(CassandraDomainMaxQuota.DOMAIN, bindMarker()));
}
 
Example 4
Source File: CassandraPerDomainMaxQuotaDao.java    From james-project with Apache License 2.0 4 votes vote down vote up
private Delete.Where removeMaxStorageStatement() {
    return delete().column(CassandraDomainMaxQuota.STORAGE)
        .from(CassandraDomainMaxQuota.TABLE_NAME)
        .where(eq(CassandraDomainMaxQuota.DOMAIN, bindMarker()));
}
 
Example 5
Source File: CassandraGlobalMaxQuotaDao.java    From james-project with Apache License 2.0 4 votes vote down vote up
private Delete.Where removeGlobalMaxQuotaStatement() {
    return delete().all()
        .from(CassandraGlobalMaxQuota.TABLE_NAME)
        .where(eq(CassandraGlobalMaxQuota.TYPE, bindMarker(CassandraGlobalMaxQuota.TYPE)));
}
 
Example 6
Source File: CassandraPerUserMaxQuotaDao.java    From james-project with Apache License 2.0 4 votes vote down vote up
private Delete.Where removeMaxMessageStatement() {
    return delete().column(CassandraMaxQuota.MESSAGE_COUNT)
        .from(CassandraMaxQuota.TABLE_NAME)
        .where(eq(CassandraMaxQuota.QUOTA_ROOT, bindMarker()));
}
 
Example 7
Source File: CassandraPerUserMaxQuotaDao.java    From james-project with Apache License 2.0 4 votes vote down vote up
private Delete.Where removeMaxStorageStatement() {
    return delete().column(CassandraMaxQuota.STORAGE)
        .from(CassandraMaxQuota.TABLE_NAME)
        .where(eq(CassandraMaxQuota.QUOTA_ROOT, bindMarker()));
}