} else { assert order.getValue() == Order.DESC; select.orderBy(QueryBuilder.desc(name));
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY c1 DESC</strong> */ public final MultiClusteringEntity_Select.W_C1 orderByC1Descending() { where.orderBy(QueryBuilder.desc("c1")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithUDTForDynamicKeyspace_Select.W_TM_Clust orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithNoKeyspaceUDT_Select.W_Clust orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithNoKeyspaceUDT_Select.W_TM_Clust orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithNoKeyspaceUDT_Select.E_J orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; } }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithSASIIndices_SelectIndex.E_TM orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithSASIIndices_SelectIndex.E_J orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY c1 DESC</strong> */ public final MultiClusteringEntity_Select.E orderByC1Descending() { where.orderBy(QueryBuilder.desc("c1")); return this; } }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY c1 DESC</strong> */ public final MultiClusteringEntity_Select.W_TM_C2 orderByC1Descending() { where.orderBy(QueryBuilder.desc("c1")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY c1 DESC</strong> */ public final MultiClusteringEntity_Select.W_J_C1 orderByC1Descending() { where.orderBy(QueryBuilder.desc("c1")); return this; }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY c1 DESC</strong> */ public final MultiClusteringEntity_Select.E_J orderByC1Descending() { where.orderBy(QueryBuilder.desc("c1")); return this; } }
/** * Generate a SELECT ... FROM ... WHERE ... <strong>ORDER BY clust DESC</strong> */ public final EntityWithSASIIndices_Select.E_TM orderByClustDescending() { where.orderBy(QueryBuilder.desc("clust")); return this; } }
.where(in("a", InetAddress.getByName("127.0.0.1"), InetAddress.getByName("127.0.0.3"))) .and(eq(quote("C"), "foo")) .orderBy(asc("a"), desc("b")) .limit(42); assertEquals(select.toString(), query); select().countAll().from("foo").orderBy(asc("a"), desc("b")).orderBy(asc("a"), desc("b")); fail("Expected an IllegalStateException"); } catch (IllegalStateException e) {
private Ordering getOrdering(Scan.Ordering ordering) { switch (ordering.getOrder()) { case ASC: return QueryBuilder.asc(ordering.getName()); case DESC: return QueryBuilder.desc(ordering.getName()); default: LOGGER.warn("Unsupported ordering specified. Using Order.ASC."); return QueryBuilder.asc(ordering.getName()); } }
.where(eq("a", 1)) .groupBy("a", "b", "c") .orderBy(desc("b"), desc("c")))) .containsExactly(row(1, 4, 24, 2L, 24), row(1, 2, 12, 1L, 12), row(1, 2, 6, 1L, 6)); .where(eq("a", 1)) .groupBy("a", "b", "c") .orderBy(desc("b"), desc("c")) .perPartitionLimit(1))) .containsExactly(row(1, 4, 24, 2L, 24)); .where(eq("a", 1)) .groupBy("a", "b", "c") .orderBy(desc("b"), desc("c")) .limit(2))) .containsExactly(row(1, 4, 24, 2L, 24), row(1, 2, 12, 1L, 12)); .where(in("a", 1, 2, 4)) .groupBy("a", "b") .orderBy(desc("b"), desc("c")) .setFetchSize(Integer.MAX_VALUE))) .containsExactly( .where(in("a", 1, 2, 4)) .groupBy("a", "b") .orderBy(desc("b"), desc("c")) .limit(3) .setFetchSize(Integer.MAX_VALUE)))
private Statement createQueryToFindMessagesByApplication(String applicationId) { UUID appId = UUID.fromString(applicationId); return QueryBuilder .select() .all() .from(Messages.TABLE_NAME) .where(eq(APP_ID, appId)) .orderBy(desc(MESSAGE_ID)) .limit(3000); }
private Statement createQueryToFindMessagesByApplication(String applicationId) { UUID appId = UUID.fromString(applicationId); return queryBuilder .select() .all() .from(Messages.TABLE_NAME) .where(eq(APP_ID, appId)) .orderBy(desc(MESSAGE_ID)) .limit(3000); }