コード例 #1
0
  // @Test
  public void testFindIndexedColumns() {

    List<CassandraIndexColumn> indexedColumns =
        mapper.findIndexedColumns(Comment.class, "commentedBy", "lorenabittencourt");
    for (CassandraIndexColumn indexColumn : indexedColumns) {
      System.out.println(
          TimeUUIDUtils.toDate(indexColumn.indexer()) + ": " + indexColumn.indexedKey());
    }
  }
コード例 #2
0
  // @Test
  public void testUpdateIndex() {

    String[] authors = {"diegossilveira", "nayarasilveira", "lorenabittencourt"};

    for (int i = 200; i <= 500; i++) {
      Comment comment =
          new Comment(TimeUUIDUtils.getTimeUUID(), authors[i % 3], "My comment " + i / 3);
      mapper.store(comment);
      mapper.updateIndex(comment, "commentedBy");
    }
  }