@Test public void testSelectAllSuppressesKeyColumn() { CqlQuery<String,String,Long> cqlQuery = new CqlQuery<String,String,Long>(keyspace, se, se, le); cqlQuery.setQuery("select * from StandardLong1"); cqlQuery.setSuppressKeyInColumns(true); QueryResult<CqlRows<String,String,Long>> result = cqlQuery.execute(); CqlRows<String, String, Long> rows = result.get(); // check that we contain a 'key' column assertNull(rows.getList().get(0).getColumnSlice().getColumnByName("KEY")); // arbitrary row check assertNull(rows.getList().get(3).getColumnSlice().getColumnByName("KEY")); assertEquals(6,rows.getCount()); }
@Test public void testSimpleSelect() { CqlQuery<String,String,Long> cqlQuery = new CqlQuery<String,String,Long>(keyspace, se, se, le); cqlQuery.setQuery("select * from StandardLong1"); QueryResult<CqlRows<String,String,Long>> result = cqlQuery.execute(); CqlRows<String, String, Long> rows = result.get(); // check that we contain a 'key' column assertNotNull(rows.getList().get(0).getColumnSlice().getColumnByName("KEY")); assertEquals(6 + customColumns,rows.getCount()); }
result.add(entity); } else { for (Row<String, String, Object> orderedRow : cqlRows.getList()) { ColumnSlice<String, Object> slice = orderedRow.getColumnSlice(); List<HColumn<String, Object>> columns = slice.getColumns();