All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.archinnov.achilles.generated.dsl.EntityWithStaticColumn_Delete Maven / Gradle / Ivy

package info.archinnov.achilles.generated.dsl;

import com.datastax.driver.core.querybuilder.Delete;
import com.datastax.driver.core.querybuilder.NotEq;
import com.datastax.driver.core.querybuilder.QueryBuilder;
import info.archinnov.achilles.generated.meta.entity.EntityWithStaticColumn_AchillesMeta;
import info.archinnov.achilles.internals.entities.EntityWithStaticColumn;
import info.archinnov.achilles.internals.metamodel.AbstractEntityProperty;
import info.archinnov.achilles.internals.options.Options;
import info.archinnov.achilles.internals.query.dsl.delete.AbstractDelete;
import info.archinnov.achilles.internals.query.dsl.delete.AbstractDeleteColumns;
import info.archinnov.achilles.internals.query.dsl.delete.AbstractDeleteEnd;
import info.archinnov.achilles.internals.query.dsl.delete.AbstractDeleteFrom;
import info.archinnov.achilles.internals.query.dsl.delete.AbstractDeleteWhere;
import info.archinnov.achilles.internals.query.dsl.delete.AbstractDeleteWherePartition;
import info.archinnov.achilles.internals.runtime.RuntimeEngine;
import info.archinnov.achilles.type.SchemaNameProvider;
import java.lang.Class;
import java.lang.Long;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.UUID;

public final class EntityWithStaticColumn_Delete extends AbstractDelete {
  protected final EntityWithStaticColumn_AchillesMeta meta;

  protected final Class entityClass = EntityWithStaticColumn.class;

  public EntityWithStaticColumn_Delete(RuntimeEngine rte, EntityWithStaticColumn_AchillesMeta meta) {
    super(rte);
    this.meta = meta;
  }

  /**
   * Generate DELETE static_col ... */
  public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns staticCol() {
    delete.column("static_col");
    return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns(delete);
  }

  /**
   * Generate DELETE another_static_col ... */
  public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns anotherStaticCol() {
    delete.column("another_static_col");
    return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns(delete);
  }

  /**
   * Generate DELETE value ... */
  public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns value() {
    delete.column("value");
    return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns(delete);
  }

  /**
   * Generate ... * FROM ... */
  public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom allColumns_FromBaseTable() {
    final Delete.Where where = delete.all().from(meta.getKeyspace().orElse("unknown_keyspace_for_" + meta.entityClass.getCanonicalName()), meta.getTableOrViewName()).where();
    return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom(where);
  }

  /**
   * Generate ... * FROM ... using the given SchemaNameProvider */
  public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom allColumns_From(final SchemaNameProvider schemaNameProvider) {
    final String currentKeyspace = lookupKeyspace(schemaNameProvider, meta.entityClass);
    final String currentTable = lookupTable(schemaNameProvider, meta.entityClass);
    final Delete.Where where = delete.all().from(currentKeyspace, currentTable).where();
    return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom(where);
  }

  public class EntityWithStaticColumn_DeleteColumns extends AbstractDeleteColumns {
    EntityWithStaticColumn_DeleteColumns(Delete.Selection deleteColumns) {
      super(deleteColumns);
    }

    /**
     * Generate DELETE static_col ... */
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns staticCol() {
      delete.column("static_col");
      return this;
    }

    /**
     * Generate DELETE another_static_col ... */
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns anotherStaticCol() {
      delete.column("another_static_col");
      return this;
    }

    /**
     * Generate DELETE value ... */
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteColumns value() {
      delete.column("value");
      return this;
    }

    /**
     * Generate a ... FROM xxx ...  */
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom fromBaseTable() {
      final Delete.Where where = deleteColumns.from(meta.getKeyspace().orElse("unknown_keyspace_for_" + meta.entityClass.getCanonicalName()), meta.getTableOrViewName()).where();
      return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom(where);
    }

    /**
     * Generate a ... FROM xxx ... using the given SchemaNameProvider */
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom from(final SchemaNameProvider schemaNameProvider) {
      final String currentKeyspace = lookupKeyspace(schemaNameProvider, meta.entityClass);
      final String currentTable = lookupTable(schemaNameProvider, meta.entityClass);
      final Delete.Where where = deleteColumns.from(currentKeyspace, currentTable).where();
      return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteFrom(where);
    }
  }

  public class EntityWithStaticColumn_DeleteFrom extends AbstractDeleteFrom {
    EntityWithStaticColumn_DeleteFrom(Delete.Where where) {
      super(where);
    }

    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteWhere_Id where() {
      return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteWhere_Id(where);
    }
  }

  public final class EntityWithStaticColumn_DeleteWhere_Id extends AbstractDeleteWherePartition {
    public EntityWithStaticColumn_DeleteWhere_Id(Delete.Where where) {
      super(where);
    }

    /**
     * Generate a SELECT ... FROM ... WHERE ... id = ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteWhere_Uuid id_Eq(Long id) {
      where.and(QueryBuilder.eq("id", QueryBuilder.bindMarker("id_Eq")));
      boundValues.add(id);
      encodedValues.add(meta.id.encodeFromJava(id));
      return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteWhere_Uuid(where);
    }
  }

  public final class EntityWithStaticColumn_DeleteWhere_Uuid extends AbstractDeleteWhere {
    public EntityWithStaticColumn_DeleteWhere_Uuid(Delete.Where where) {
      super(where);
    }

    /**
     * Generate a SELECT ... FROM ... WHERE ... uuid = ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd uuid_Eq(UUID uuid) {
      where.and(QueryBuilder.eq("uuid", QueryBuilder.bindMarker("uuid_Eq")));
      boundValues.add(uuid);
      encodedValues.add(meta.uuid.encodeFromJava(uuid));
      return new EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd(where);
    }
  }

  public final class EntityWithStaticColumn_DeleteEnd extends AbstractDeleteEnd {
    public EntityWithStaticColumn_DeleteEnd(Delete.Where where) {
      super(where);
    }

    @Override
    protected final Class getEntityClass() {
      return entityClass;
    }

    @Override
    protected final AbstractEntityProperty getMetaInternal() {
      return meta;
    }

    @Override
    protected final RuntimeEngine getRte() {
      return rte;
    }

    @Override
    protected final Options getOptions() {
      return options;
    }

    @Override
    protected final List getBoundValuesInternal() {
      return boundValues;
    }

    @Override
    protected final List getEncodedValuesInternal() {
      return encodedValues;
    }

    @Override
    protected final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd getThis() {
      return this;
    }

    /**
     * Generate an ... IF staticCol = ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifStaticCol_Eq(final String staticCol) {
      boundValues.add(staticCol);
      encodedValues.add(meta.staticCol.encodeFromJava(staticCol));
      where.onlyIf(QueryBuilder.eq("static_col", QueryBuilder.bindMarker("static_col")));
      return this;
    }

    /**
     * Generate an ... IF staticCol > ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifStaticCol_Gt(final String staticCol) {
      boundValues.add(staticCol);
      encodedValues.add(meta.staticCol.encodeFromJava(staticCol));
      where.onlyIf(QueryBuilder.gt("static_col", QueryBuilder.bindMarker("static_col")));
      return this;
    }

    /**
     * Generate an ... IF staticCol >= ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifStaticCol_Gte(final String staticCol) {
      boundValues.add(staticCol);
      encodedValues.add(meta.staticCol.encodeFromJava(staticCol));
      where.onlyIf(QueryBuilder.gte("static_col", QueryBuilder.bindMarker("static_col")));
      return this;
    }

    /**
     * Generate an ... IF staticCol < ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifStaticCol_Lt(final String staticCol) {
      boundValues.add(staticCol);
      encodedValues.add(meta.staticCol.encodeFromJava(staticCol));
      where.onlyIf(QueryBuilder.lt("static_col", QueryBuilder.bindMarker("static_col")));
      return this;
    }

    /**
     * Generate an ... IF staticCol <= ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifStaticCol_Lte(final String staticCol) {
      boundValues.add(staticCol);
      encodedValues.add(meta.staticCol.encodeFromJava(staticCol));
      where.onlyIf(QueryBuilder.lte("static_col", QueryBuilder.bindMarker("static_col")));
      return this;
    }

    /**
     * Generate an  ... IF staticCol != ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifStaticCol_NotEq(final String staticCol) {
      boundValues.add(staticCol);
      encodedValues.add(meta.staticCol.encodeFromJava(staticCol));
      where.onlyIf(NotEq.of("static_col", QueryBuilder.bindMarker("static_col")));
      return this;
    }

    /**
     * Generate an ... IF anotherStaticCol = ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifAnotherStaticCol_Eq(final String anotherStaticCol) {
      boundValues.add(anotherStaticCol);
      encodedValues.add(meta.anotherStaticCol.encodeFromJava(anotherStaticCol));
      where.onlyIf(QueryBuilder.eq("another_static_col", QueryBuilder.bindMarker("another_static_col")));
      return this;
    }

    /**
     * Generate an ... IF anotherStaticCol > ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifAnotherStaticCol_Gt(final String anotherStaticCol) {
      boundValues.add(anotherStaticCol);
      encodedValues.add(meta.anotherStaticCol.encodeFromJava(anotherStaticCol));
      where.onlyIf(QueryBuilder.gt("another_static_col", QueryBuilder.bindMarker("another_static_col")));
      return this;
    }

    /**
     * Generate an ... IF anotherStaticCol >= ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifAnotherStaticCol_Gte(final String anotherStaticCol) {
      boundValues.add(anotherStaticCol);
      encodedValues.add(meta.anotherStaticCol.encodeFromJava(anotherStaticCol));
      where.onlyIf(QueryBuilder.gte("another_static_col", QueryBuilder.bindMarker("another_static_col")));
      return this;
    }

    /**
     * Generate an ... IF anotherStaticCol < ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifAnotherStaticCol_Lt(final String anotherStaticCol) {
      boundValues.add(anotherStaticCol);
      encodedValues.add(meta.anotherStaticCol.encodeFromJava(anotherStaticCol));
      where.onlyIf(QueryBuilder.lt("another_static_col", QueryBuilder.bindMarker("another_static_col")));
      return this;
    }

    /**
     * Generate an ... IF anotherStaticCol <= ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifAnotherStaticCol_Lte(final String anotherStaticCol) {
      boundValues.add(anotherStaticCol);
      encodedValues.add(meta.anotherStaticCol.encodeFromJava(anotherStaticCol));
      where.onlyIf(QueryBuilder.lte("another_static_col", QueryBuilder.bindMarker("another_static_col")));
      return this;
    }

    /**
     * Generate an  ... IF anotherStaticCol != ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifAnotherStaticCol_NotEq(final String anotherStaticCol) {
      boundValues.add(anotherStaticCol);
      encodedValues.add(meta.anotherStaticCol.encodeFromJava(anotherStaticCol));
      where.onlyIf(NotEq.of("another_static_col", QueryBuilder.bindMarker("another_static_col")));
      return this;
    }

    /**
     * Generate an ... IF value = ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifValue_Eq(final String value) {
      boundValues.add(value);
      encodedValues.add(meta.value.encodeFromJava(value));
      where.onlyIf(QueryBuilder.eq("value", QueryBuilder.bindMarker("value")));
      return this;
    }

    /**
     * Generate an ... IF value > ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifValue_Gt(final String value) {
      boundValues.add(value);
      encodedValues.add(meta.value.encodeFromJava(value));
      where.onlyIf(QueryBuilder.gt("value", QueryBuilder.bindMarker("value")));
      return this;
    }

    /**
     * Generate an ... IF value >= ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifValue_Gte(final String value) {
      boundValues.add(value);
      encodedValues.add(meta.value.encodeFromJava(value));
      where.onlyIf(QueryBuilder.gte("value", QueryBuilder.bindMarker("value")));
      return this;
    }

    /**
     * Generate an ... IF value < ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifValue_Lt(final String value) {
      boundValues.add(value);
      encodedValues.add(meta.value.encodeFromJava(value));
      where.onlyIf(QueryBuilder.lt("value", QueryBuilder.bindMarker("value")));
      return this;
    }

    /**
     * Generate an ... IF value <= ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifValue_Lte(final String value) {
      boundValues.add(value);
      encodedValues.add(meta.value.encodeFromJava(value));
      where.onlyIf(QueryBuilder.lte("value", QueryBuilder.bindMarker("value")));
      return this;
    }

    /**
     * Generate an  ... IF value != ? */
    @SuppressWarnings("static-access")
    public final EntityWithStaticColumn_Delete.EntityWithStaticColumn_DeleteEnd ifValue_NotEq(final String value) {
      boundValues.add(value);
      encodedValues.add(meta.value.encodeFromJava(value));
      where.onlyIf(NotEq.of("value", QueryBuilder.bindMarker("value")));
      return this;
    }
  }
}