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

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

The newest version!
package info.archinnov.achilles.generated.dsl;

import com.datastax.driver.core.querybuilder.QueryBuilder;
import com.datastax.driver.core.querybuilder.Select;
import info.archinnov.achilles.generated.meta.entity.EntityWithIndexOnClustering_AchillesMeta;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelect;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectColumns;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectColumnsTypeMap;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectFrom;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectFromTypeMap;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectWhere;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectWherePartition;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectWherePartitionTypeMap;
import info.archinnov.achilles.internals.dsl.query.select.AbstractSelectWhereTypeMap;
import info.archinnov.achilles.internals.entities.EntityWithIndexOnClustering;
import info.archinnov.achilles.internals.metamodel.AbstractEntityProperty;
import info.archinnov.achilles.internals.metamodel.functions.FunctionCall;
import info.archinnov.achilles.internals.options.CassandraOptions;
import info.archinnov.achilles.internals.runtime.RuntimeEngine;
import info.archinnov.achilles.type.SchemaNameProvider;
import info.archinnov.achilles.validation.Validator;
import java.lang.Class;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ArrayUtils;

public final class EntityWithIndexOnClustering_Select extends AbstractSelect {
  protected final EntityWithIndexOnClustering_AchillesMeta meta;

  protected final Class entityClass = EntityWithIndexOnClustering.class;

  public EntityWithIndexOnClustering_Select(RuntimeEngine rte, EntityWithIndexOnClustering_AchillesMeta meta) {
    super(rte);
    this.meta = meta;
  }

  /**
   * Generate a SELECT ... partition ... */
  public final EntityWithIndexOnClustering_Select.Cols partition() {
    select.column("partition");
    return new EntityWithIndexOnClustering_Select.Cols(select);
  }

  /**
   * Generate a SELECT ... clustering ... */
  public final EntityWithIndexOnClustering_Select.Cols clustering() {
    select.column("clustering");
    return new EntityWithIndexOnClustering_Select.Cols(select);
  }

  /**
   * Generate a SELECT ... value ... */
  public final EntityWithIndexOnClustering_Select.Cols value() {
    select.column("value");
    return new EntityWithIndexOnClustering_Select.Cols(select);
  }

  /**
   * Use this method to call a system or user-defined function.
All the system functions are accessible from the {@link info.archinnov.achilles.generated.function.SystemFunctions} class
All the user-defined functions and aggregates are accessible from the {@link info.archinnov.achilles.generated.function.FunctionsRegistry} class
System and user-defined functions accept only appropriate type. To pass in an entity field as function argument, use the generated manager.COLUMNS class which exposes all columns with their appropriate type
Example:

   *   {@literal @}Table
   *   public class MyEntity {
   *
   *       ...
   *
   *       {@literal @}Column("value_column")
   *       private String value;
   *
   *       {@literal @}Column("list_of_string")
   *       private List strings;
   *
   *       ...
   *
   *   }
   *
   *   {@literal @}FunctionsRegistry
   *   public interface MyFunctions {
   *
   *        String convertListToJson(List strings);
   *
   *   }
   *
   *
   *   ...
   *
   *
   *   manager
   *      .dsl()
   *      .select()
   *      // This call will generate SELECT cast(writetime(value_column) as text) AS writetimeOfValueAsString, ...
   *      .function(SystemFunctions.castAsText(SystemFunctions.writetime(manager.COLUMNS.VALUE)), "writetimeOfValueAsString")
   *      ...
   *
   *   manager
   *      .dsl()
   *      .select()
   *      // This call will generate SELECT convertlisttojson(list_of_string) AS strings_as_json, ...
   *      .function(FunctionsRegistry.convertListToJson(manager.COLUMNS.STRINGS), "strings_as_json")
   *      ...
   *
   * 
*
* @param functionCall the function call object * @param alias mandatory alias for this function call for easier retrieval from the ResultSet * @return a built-in function call passed to the QueryBuilder object */ public final EntityWithIndexOnClustering_Select.ColsTM function(final FunctionCall functionCall, final String alias) { functionCall.addToSelect(select, alias); return new EntityWithIndexOnClustering_Select.ColsTM(select); } /** * Generate ... * FROM ... */ public final EntityWithIndexOnClustering_Select.F allColumns_FromBaseTable() { final Select.Where where = select.all().from(meta.getKeyspace().orElse("unknown_keyspace_for_" + meta.entityClass.getCanonicalName()), meta.getTableOrViewName()).where(); return new EntityWithIndexOnClustering_Select.F(where, new CassandraOptions()); } /** * Generate ... * FROM ... using the given SchemaNameProvider */ public final EntityWithIndexOnClustering_Select.F allColumns_From(final SchemaNameProvider schemaNameProvider) { final String currentKeyspace = lookupKeyspace(schemaNameProvider, meta.entityClass); final String currentTable = lookupTable(schemaNameProvider, meta.entityClass); final Select.Where where = select.all().from(currentKeyspace, currentTable).where(); return new EntityWithIndexOnClustering_Select.F(where, CassandraOptions.withSchemaNameProvider(schemaNameProvider)); } public class Cols extends AbstractSelectColumns { public Cols(Select.Selection selection) { super(selection); } /** * Generate a SELECT ... partition ... */ public final EntityWithIndexOnClustering_Select.Cols partition() { selection.column("partition"); return this; } /** * Generate a SELECT ... clustering ... */ public final EntityWithIndexOnClustering_Select.Cols clustering() { selection.column("clustering"); return this; } /** * Generate a SELECT ... value ... */ public final EntityWithIndexOnClustering_Select.Cols value() { selection.column("value"); return this; } /** * Use this method to call a system or user-defined function.
All the system functions are accessible from the {@link info.archinnov.achilles.generated.function.SystemFunctions} class
All the user-defined functions and aggregates are accessible from the {@link info.archinnov.achilles.generated.function.FunctionsRegistry} class
System and user-defined functions accept only appropriate type. To pass in an entity field as function argument, use the generated manager.COLUMNS class which exposes all columns with their appropriate type
Example:

     *   {@literal @}Table
     *   public class MyEntity {
     *
     *       ...
     *
     *       {@literal @}Column("value_column")
     *       private String value;
     *
     *       {@literal @}Column("list_of_string")
     *       private List strings;
     *
     *       ...
     *
     *   }
     *
     *   {@literal @}FunctionsRegistry
     *   public interface MyFunctions {
     *
     *        String convertListToJson(List strings);
     *
     *   }
     *
     *
     *   ...
     *
     *
     *   manager
     *      .dsl()
     *      .select()
     *      // This call will generate SELECT cast(writetime(value_column) as text) AS writetimeOfValueAsString, ...
     *      .function(SystemFunctions.castAsText(SystemFunctions.writetime(manager.COLUMNS.VALUE)), "writetimeOfValueAsString")
     *      ...
     *
     *   manager
     *      .dsl()
     *      .select()
     *      // This call will generate SELECT convertlisttojson(list_of_string) AS strings_as_json, ...
     *      .function(FunctionsRegistry.convertListToJson(manager.COLUMNS.STRINGS), "strings_as_json")
     *      ...
     *
     * 
*
* @param functionCall the function call object * @param alias mandatory alias for this function call for easier retrieval from the ResultSet * @return a built-in function call passed to the QueryBuilder object */ public final EntityWithIndexOnClustering_Select.ColsTM function(final FunctionCall functionCall, final String alias) { functionCall.addToSelect(selection, alias); return new EntityWithIndexOnClustering_Select.ColsTM(select); } /** * Generate a ... FROM xxx ... */ public final EntityWithIndexOnClustering_Select.F fromBaseTable() { final Select.Where where = selection.from(meta.getKeyspace().orElse("unknown_keyspace_for_" + meta.entityClass.getCanonicalName()), meta.getTableOrViewName()).where(); return new EntityWithIndexOnClustering_Select.F(where, new CassandraOptions()); } /** * Generate a ... FROM xxx ... using the given SchemaNameProvider */ public final EntityWithIndexOnClustering_Select.F from(final SchemaNameProvider schemaNameProvider) { final String currentKeyspace = lookupKeyspace(schemaNameProvider, meta.entityClass); final String currentTable = lookupTable(schemaNameProvider, meta.entityClass); final Select.Where where = selection.from(currentKeyspace, currentTable).where(); return new EntityWithIndexOnClustering_Select.F(where, CassandraOptions.withSchemaNameProvider(schemaNameProvider)); } } public class ColsTM extends AbstractSelectColumnsTypeMap { public ColsTM(Select.Selection selection) { super(selection); } /** * Generate a SELECT ... partition ... */ public final EntityWithIndexOnClustering_Select.ColsTM partition() { selection.column("partition"); return this; } /** * Generate a SELECT ... clustering ... */ public final EntityWithIndexOnClustering_Select.ColsTM clustering() { selection.column("clustering"); return this; } /** * Generate a SELECT ... value ... */ public final EntityWithIndexOnClustering_Select.ColsTM value() { selection.column("value"); return this; } /** * Use this method to call a system or user-defined function.
All the system functions are accessible from the {@link info.archinnov.achilles.generated.function.SystemFunctions} class
All the user-defined functions and aggregates are accessible from the {@link info.archinnov.achilles.generated.function.FunctionsRegistry} class
System and user-defined functions accept only appropriate type. To pass in an entity field as function argument, use the generated manager.COLUMNS class which exposes all columns with their appropriate type
Example:

     *   {@literal @}Table
     *   public class MyEntity {
     *
     *       ...
     *
     *       {@literal @}Column("value_column")
     *       private String value;
     *
     *       {@literal @}Column("list_of_string")
     *       private List strings;
     *
     *       ...
     *
     *   }
     *
     *   {@literal @}FunctionsRegistry
     *   public interface MyFunctions {
     *
     *        String convertListToJson(List strings);
     *
     *   }
     *
     *
     *   ...
     *
     *
     *   manager
     *      .dsl()
     *      .select()
     *      // This call will generate SELECT cast(writetime(value_column) as text) AS writetimeOfValueAsString, ...
     *      .function(SystemFunctions.castAsText(SystemFunctions.writetime(manager.COLUMNS.VALUE)), "writetimeOfValueAsString")
     *      ...
     *
     *   manager
     *      .dsl()
     *      .select()
     *      // This call will generate SELECT convertlisttojson(list_of_string) AS strings_as_json, ...
     *      .function(FunctionsRegistry.convertListToJson(manager.COLUMNS.STRINGS), "strings_as_json")
     *      ...
     *
     * 
*
* @param functionCall the function call object * @param alias mandatory alias for this function call for easier retrieval from the ResultSet * @return a built-in function call passed to the QueryBuilder object */ public final EntityWithIndexOnClustering_Select.ColsTM function(final FunctionCall functionCall, final String alias) { functionCall.addToSelect(selection, alias); return this; } /** * Generate a ... FROM xxx ... */ public final EntityWithIndexOnClustering_Select.F_TM fromBaseTable() { final Select.Where where = selection.from(meta.getKeyspace().orElse("unknown_keyspace_for_" + meta.entityClass.getCanonicalName()), meta.getTableOrViewName()).where(); return new EntityWithIndexOnClustering_Select.F_TM(where, new CassandraOptions()); } /** * Generate a ... FROM xxx ... using the given SchemaNameProvider */ public final EntityWithIndexOnClustering_Select.F_TM from(final SchemaNameProvider schemaNameProvider) { final String currentKeyspace = lookupKeyspace(schemaNameProvider, meta.entityClass); final String currentTable = lookupTable(schemaNameProvider, meta.entityClass); final Select.Where where = selection.from(currentKeyspace, currentTable).where(); return new EntityWithIndexOnClustering_Select.F_TM(where, CassandraOptions.withSchemaNameProvider(schemaNameProvider)); } } public class F extends AbstractSelectFrom { F(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... */ public final EntityWithIndexOnClustering_Select.W_Partition where() { return new EntityWithIndexOnClustering_Select.W_Partition(where, cassandraOptions); } /** * Generate a SELECT statement without the WHERE clause */ public final EntityWithIndexOnClustering_Select.E without_WHERE_Clause() { return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } } public class F_TM extends AbstractSelectFromTypeMap { F_TM(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... */ public final EntityWithIndexOnClustering_Select.W_TM_Partition where() { return new EntityWithIndexOnClustering_Select.W_TM_Partition(where, cassandraOptions); } /** * Generate a SELECT statement without the WHERE clause */ public final EntityWithIndexOnClustering_Select.E_TM without_WHERE_Clause() { return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } } public final class W_Partition extends AbstractSelectWherePartition { public W_Partition(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } public final EntityWithIndexOnClustering_Select.W_Partition.Relation partition() { return new EntityWithIndexOnClustering_Select.W_Partition.Relation(); } public final EntityWithIndexOnClustering_Select.W_Partition.Token tokenValueOf_partition() { return new EntityWithIndexOnClustering_Select.W_Partition.Token(); } public final class Relation { /** * Generate a SELECT ... FROM ... WHERE ... partition = ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.W_Clustering Eq(Long partition) { where.and(QueryBuilder.eq("partition", QueryBuilder.bindMarker("partition"))); boundValues.add(partition); encodedValues.add(meta.partition.encodeFromJava(partition, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.W_Clustering(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... partition IN ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.W_Clustering IN(Long... partition) { Validator.validateTrue(ArrayUtils.isNotEmpty(partition), "Varargs for field '%s' should not be null/empty", "partition"); where.and(QueryBuilder.in("partition",QueryBuilder.bindMarker("partition"))); final List varargs = Arrays.asList((Object[])partition); final List encodedVarargs = Arrays.stream((Long[])partition).map(x -> meta.partition.encodeFromJava(x, Optional.of(cassandraOptions))).collect(Collectors.toList()); boundValues.add(varargs); encodedValues.add(encodedVarargs); return new EntityWithIndexOnClustering_Select.W_Clustering(where, cassandraOptions); } } public final class Token { /** * Generate a SELECT ... FROM ... WHERE ... token(partition) = ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Eq(Long tokenValue) { where.and(QueryBuilder.eq("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) > ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gt(Long tokenValue) { where.and(QueryBuilder.gt("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) >= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gte(Long tokenValue) { where.and(QueryBuilder.gte("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Lt(Long tokenValue) { where.and(QueryBuilder.lt("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Lte(Long tokenValue) { where.and(QueryBuilder.lte("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) > ? AND token(partition) < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gt_And_Lt(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gt("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lt("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) > ? AND token(partition) <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gt_And_Lte(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gt("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lte("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) >= ? AND token(partition) < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gte_And_Lt(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gte("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lt("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) >= ? AND token(partition) <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gte_And_Lte(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gte("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lte("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } } } public final class W_Clustering extends AbstractSelectWhere { public W_Clustering(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } @Override protected final EntityWithIndexOnClustering_Select.W_Clustering getThis() { return this; } @Override protected final AbstractEntityProperty getMetaInternal() { return meta; } @Override protected final Class getEntityClass() { return entityClass; } @Override protected final RuntimeEngine getRte() { return rte; } @Override protected final CassandraOptions getOptions() { return cassandraOptions; } @Override protected final List getBoundValuesInternal() { return boundValues; } @Override protected final List getEncodedValuesInternal() { return encodedValues; } /** * Generate a SELECT ... FROM ... WHERE ... LIMIT :limit */ public final EntityWithIndexOnClustering_Select.W_Clustering limit(final Integer limit) { where.limit(QueryBuilder.bindMarker("lim")); boundValues.add(limit); encodedValues.add(limit); return this; } public final EntityWithIndexOnClustering_Select.W_Clustering.Relation clustering() { return new EntityWithIndexOnClustering_Select.W_Clustering.Relation(); } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering ASC */ public final EntityWithIndexOnClustering_Select.W_Clustering orderByClusteringAscending() { where.orderBy(QueryBuilder.asc("clustering")); return this; } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering DESC */ public final EntityWithIndexOnClustering_Select.W_Clustering orderByClusteringDescending() { where.orderBy(QueryBuilder.desc("clustering")); return this; } public final class Relation { /** * Generate a SELECT ... FROM ... WHERE ... clustering = ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Eq(Integer clustering) { where.and(QueryBuilder.eq("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering IN ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E IN(Integer... clustering) { Validator.validateTrue(ArrayUtils.isNotEmpty(clustering), "Varargs for field '%s' should not be null/empty", "clustering"); where.and(QueryBuilder.in("clustering",QueryBuilder.bindMarker("clustering"))); final List varargs = Arrays.asList((Object[])clustering); final List encodedVarargs = Arrays.stream((Integer[])clustering).map(x -> meta.clustering.encodeFromJava(x, Optional.of(cassandraOptions))).collect(Collectors.toList()); boundValues.add(varargs); encodedValues.add(encodedVarargs); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering > ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gt(Integer clustering) { where.and(QueryBuilder.gt("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering >= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gte(Integer clustering) { where.and(QueryBuilder.gte("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Lt(Integer clustering) { where.and(QueryBuilder.lt("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Lte(Integer clustering) { where.and(QueryBuilder.lte("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering > ? AND clustering < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gt_And_Lt(Integer clustering_Gt, Integer clustering_Lt) { where.and(QueryBuilder.gt("clustering",QueryBuilder.bindMarker("clustering_Lt"))); where.and(QueryBuilder.lt("clustering",QueryBuilder.bindMarker("clustering_Lt"))); boundValues.add(clustering_Gt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gt, Optional.of(cassandraOptions))); boundValues.add(clustering_Lt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lt, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering > ? AND clustering <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gt_And_Lte(Integer clustering_Gt, Integer clustering_Lte) { where.and(QueryBuilder.gt("clustering",QueryBuilder.bindMarker("clustering_Lte"))); where.and(QueryBuilder.lte("clustering",QueryBuilder.bindMarker("clustering_Lte"))); boundValues.add(clustering_Gt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gt, Optional.of(cassandraOptions))); boundValues.add(clustering_Lte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lte, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering >= ? AND clustering < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gte_And_Lt(Integer clustering_Gte, Integer clustering_Lt) { where.and(QueryBuilder.gte("clustering",QueryBuilder.bindMarker("clustering_Lt"))); where.and(QueryBuilder.lt("clustering",QueryBuilder.bindMarker("clustering_Lt"))); boundValues.add(clustering_Gte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gte, Optional.of(cassandraOptions))); boundValues.add(clustering_Lt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lt, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering >= ? AND clustering <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E Gte_And_Lte(Integer clustering_Gte, Integer clustering_Lte) { where.and(QueryBuilder.gte("clustering",QueryBuilder.bindMarker("clustering_Lte"))); where.and(QueryBuilder.lte("clustering",QueryBuilder.bindMarker("clustering_Lte"))); boundValues.add(clustering_Gte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gte, Optional.of(cassandraOptions))); boundValues.add(clustering_Lte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lte, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E(where, cassandraOptions); } } } public final class E extends AbstractSelectWhere { public E(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } @Override protected final Class getEntityClass() { return entityClass; } @Override protected final AbstractEntityProperty getMetaInternal() { return meta; } @Override protected final RuntimeEngine getRte() { return rte; } @Override protected final CassandraOptions getOptions() { return cassandraOptions; } @Override protected final List getBoundValuesInternal() { return boundValues; } @Override protected final List getEncodedValuesInternal() { return encodedValues; } /** * Generate a SELECT ... FROM ... WHERE ... LIMIT :limit */ public final EntityWithIndexOnClustering_Select.E limit(final Integer limit) { where.limit(QueryBuilder.bindMarker("lim")); boundValues.add(limit); encodedValues.add(limit); return this; } @Override protected final EntityWithIndexOnClustering_Select.E getThis() { return this; } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering ASC */ public final EntityWithIndexOnClustering_Select.E orderByClusteringAscending() { where.orderBy(QueryBuilder.asc("clustering")); return this; } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering DESC */ public final EntityWithIndexOnClustering_Select.E orderByClusteringDescending() { where.orderBy(QueryBuilder.desc("clustering")); return this; } } public final class W_TM_Partition extends AbstractSelectWherePartitionTypeMap { public W_TM_Partition(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } public final EntityWithIndexOnClustering_Select.W_TM_Partition.Relation partition() { return new EntityWithIndexOnClustering_Select.W_TM_Partition.Relation(); } public final EntityWithIndexOnClustering_Select.W_TM_Partition.Token tokenValueOf_partition() { return new EntityWithIndexOnClustering_Select.W_TM_Partition.Token(); } public final class Relation { /** * Generate a SELECT ... FROM ... WHERE ... partition = ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.W_TM_Clustering Eq(Long partition) { where.and(QueryBuilder.eq("partition", QueryBuilder.bindMarker("partition"))); boundValues.add(partition); encodedValues.add(meta.partition.encodeFromJava(partition, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.W_TM_Clustering(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... partition IN ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.W_TM_Clustering IN(Long... partition) { Validator.validateTrue(ArrayUtils.isNotEmpty(partition), "Varargs for field '%s' should not be null/empty", "partition"); where.and(QueryBuilder.in("partition",QueryBuilder.bindMarker("partition"))); final List varargs = Arrays.asList((Object[])partition); final List encodedVarargs = Arrays.stream((Long[])partition).map(x -> meta.partition.encodeFromJava(x, Optional.of(cassandraOptions))).collect(Collectors.toList()); boundValues.add(varargs); encodedValues.add(encodedVarargs); return new EntityWithIndexOnClustering_Select.W_TM_Clustering(where, cassandraOptions); } } public final class Token { /** * Generate a SELECT ... FROM ... WHERE ... token(partition) = ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Eq(Long tokenValue) { where.and(QueryBuilder.eq("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) > ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gt(Long tokenValue) { where.and(QueryBuilder.gt("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) >= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gte(Long tokenValue) { where.and(QueryBuilder.gte("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Lt(Long tokenValue) { where.and(QueryBuilder.lt("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Lte(Long tokenValue) { where.and(QueryBuilder.lte("token(partition)", QueryBuilder.bindMarker("tokenValue"))); boundValues.add(tokenValue); encodedValues.add(tokenValue); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) > ? AND token(partition) < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gt_And_Lt(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gt("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lt("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) > ? AND token(partition) <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gt_And_Lte(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gt("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lte("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) >= ? AND token(partition) < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gte_And_Lt(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gte("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lt("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... token(partition) >= ? AND token(partition) <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gte_And_Lte(Long tokenValue1, Long tokenValue2) { where.and(QueryBuilder.gte("token(partition)",QueryBuilder.bindMarker("tokenValue1"))); where.and(QueryBuilder.lte("token(partition)",QueryBuilder.bindMarker("tokenValue2"))); boundValues.add(tokenValue1); encodedValues.add(tokenValue1); boundValues.add(tokenValue2); encodedValues.add(tokenValue2); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } } } public final class W_TM_Clustering extends AbstractSelectWhereTypeMap { public W_TM_Clustering(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } @Override protected final EntityWithIndexOnClustering_Select.W_TM_Clustering getThis() { return this; } @Override protected final AbstractEntityProperty getMetaInternal() { return meta; } @Override protected final Class getEntityClass() { return entityClass; } @Override protected final RuntimeEngine getRte() { return rte; } @Override protected final CassandraOptions getOptions() { return cassandraOptions; } @Override protected final List getBoundValuesInternal() { return boundValues; } @Override protected final List getEncodedValuesInternal() { return encodedValues; } /** * Generate a SELECT ... FROM ... WHERE ... LIMIT :limit */ public final EntityWithIndexOnClustering_Select.W_TM_Clustering limit(final Integer limit) { where.limit(QueryBuilder.bindMarker("lim")); boundValues.add(limit); encodedValues.add(limit); return this; } public final EntityWithIndexOnClustering_Select.W_TM_Clustering.Relation clustering() { return new EntityWithIndexOnClustering_Select.W_TM_Clustering.Relation(); } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering ASC */ public final EntityWithIndexOnClustering_Select.W_TM_Clustering orderByClusteringAscending() { where.orderBy(QueryBuilder.asc("clustering")); return this; } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering DESC */ public final EntityWithIndexOnClustering_Select.W_TM_Clustering orderByClusteringDescending() { where.orderBy(QueryBuilder.desc("clustering")); return this; } public final class Relation { /** * Generate a SELECT ... FROM ... WHERE ... clustering = ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Eq(Integer clustering) { where.and(QueryBuilder.eq("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering IN ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM IN(Integer... clustering) { Validator.validateTrue(ArrayUtils.isNotEmpty(clustering), "Varargs for field '%s' should not be null/empty", "clustering"); where.and(QueryBuilder.in("clustering",QueryBuilder.bindMarker("clustering"))); final List varargs = Arrays.asList((Object[])clustering); final List encodedVarargs = Arrays.stream((Integer[])clustering).map(x -> meta.clustering.encodeFromJava(x, Optional.of(cassandraOptions))).collect(Collectors.toList()); boundValues.add(varargs); encodedValues.add(encodedVarargs); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering > ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gt(Integer clustering) { where.and(QueryBuilder.gt("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering >= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gte(Integer clustering) { where.and(QueryBuilder.gte("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Lt(Integer clustering) { where.and(QueryBuilder.lt("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Lte(Integer clustering) { where.and(QueryBuilder.lte("clustering", QueryBuilder.bindMarker("clustering"))); boundValues.add(clustering); encodedValues.add(meta.clustering.encodeFromJava(clustering, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering > ? AND clustering < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gt_And_Lt(Integer clustering_Gt, Integer clustering_Lt) { where.and(QueryBuilder.gt("clustering",QueryBuilder.bindMarker("clustering_Lt"))); where.and(QueryBuilder.lt("clustering",QueryBuilder.bindMarker("clustering_Lt"))); boundValues.add(clustering_Gt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gt, Optional.of(cassandraOptions))); boundValues.add(clustering_Lt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lt, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering > ? AND clustering <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gt_And_Lte(Integer clustering_Gt, Integer clustering_Lte) { where.and(QueryBuilder.gt("clustering",QueryBuilder.bindMarker("clustering_Lte"))); where.and(QueryBuilder.lte("clustering",QueryBuilder.bindMarker("clustering_Lte"))); boundValues.add(clustering_Gt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gt, Optional.of(cassandraOptions))); boundValues.add(clustering_Lte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lte, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering >= ? AND clustering < ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gte_And_Lt(Integer clustering_Gte, Integer clustering_Lt) { where.and(QueryBuilder.gte("clustering",QueryBuilder.bindMarker("clustering_Lt"))); where.and(QueryBuilder.lt("clustering",QueryBuilder.bindMarker("clustering_Lt"))); boundValues.add(clustering_Gte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gte, Optional.of(cassandraOptions))); boundValues.add(clustering_Lt); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lt, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } /** * Generate a SELECT ... FROM ... WHERE ... clustering >= ? AND clustering <= ? */ @SuppressWarnings("static-access") public final EntityWithIndexOnClustering_Select.E_TM Gte_And_Lte(Integer clustering_Gte, Integer clustering_Lte) { where.and(QueryBuilder.gte("clustering",QueryBuilder.bindMarker("clustering_Lte"))); where.and(QueryBuilder.lte("clustering",QueryBuilder.bindMarker("clustering_Lte"))); boundValues.add(clustering_Gte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Gte, Optional.of(cassandraOptions))); boundValues.add(clustering_Lte); encodedValues.add(meta.clustering.encodeFromJava(clustering_Lte, Optional.of(cassandraOptions))); return new EntityWithIndexOnClustering_Select.E_TM(where, cassandraOptions); } } } public final class E_TM extends AbstractSelectWhereTypeMap { public E_TM(Select.Where where, CassandraOptions cassandraOptions) { super(where, cassandraOptions); } @Override protected final Class getEntityClass() { return entityClass; } @Override protected final AbstractEntityProperty getMetaInternal() { return meta; } @Override protected final RuntimeEngine getRte() { return rte; } @Override protected final CassandraOptions getOptions() { return cassandraOptions; } @Override protected final List getBoundValuesInternal() { return boundValues; } @Override protected final List getEncodedValuesInternal() { return encodedValues; } /** * Generate a SELECT ... FROM ... WHERE ... LIMIT :limit */ public final EntityWithIndexOnClustering_Select.E_TM limit(final Integer limit) { where.limit(QueryBuilder.bindMarker("lim")); boundValues.add(limit); encodedValues.add(limit); return this; } @Override protected final EntityWithIndexOnClustering_Select.E_TM getThis() { return this; } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering ASC */ public final EntityWithIndexOnClustering_Select.E_TM orderByClusteringAscending() { where.orderBy(QueryBuilder.asc("clustering")); return this; } /** * Generate a SELECT ... FROM ... WHERE ... ORDER BY clustering DESC */ public final EntityWithIndexOnClustering_Select.E_TM orderByClusteringDescending() { where.orderBy(QueryBuilder.desc("clustering")); return this; } } }