Package org.springframework.cassandra.core

Examples of org.springframework.cassandra.core.QueryOptions


  public void testString_AsynchronousQueryListener_QueryOptions(final ConsistencyLevel cl) throws InterruptedException {
    new AsynchronousQueryListenerTestTemplate() {
      @Override
      void doAsyncQuery(Book b, BasicListener listener) {
        t.queryAsynchronously(cql(b), listener, new QueryOptions(cl, RetryPolicy.LOGGING));
      }
    }.test();
  }
View Full Code Here


  public void testString_QueryForObjectListener_QueryOptions(final ConsistencyLevel cl) throws Exception {
    new QueryForObjectListenerTestTemplate<String>() {

      @Override
      void doAsyncQuery(Book b, QueryForObjectListener<String> listener) {
        QueryOptions opts = new QueryOptions(cl, RetryPolicy.LOGGING);
        t.queryForObjectAsynchronously(cql(b, "title"), String.class, listener, opts);
        expected = b.title;
      }

    }.test();
View Full Code Here

  public void testString_QueryForMapListener_QueryOptions(final ConsistencyLevel cl) throws Exception {
    new QueryForMapListenerTestTemplate() {

      @Override
      void doAsyncQuery(Book b, QueryForMapListener listener) {
        QueryOptions opts = new QueryOptions(cl, RetryPolicy.LOGGING);
        t.queryForMapAsynchronously(cql(b), listener, opts);
        expected = new HashMap<String, Object>();
        expected.put("isbn", b.isbn);
        expected.put("title", b.title);
      }
View Full Code Here

          row.put("title", b.title);
          row.put("isbn", b.isbn);
          expected.add(row);
        }

        t.queryForListOfMapAsynchronously(cql(titles), listener, new QueryOptions(cl, RetryPolicy.LOGGING));
      }

    }.test(2);
  }
View Full Code Here

  }

  @Test
  public void queryAsynchronouslyTestCqlStringResultSetExtractorWithOptions() {

    QueryOptions options = new QueryOptions();
    options.setConsistencyLevel(ConsistencyLevel.ONE);
    options.setRetryPolicy(RetryPolicy.DEFAULT);

    final String isbn = "999999999";

    Book b1 = cqlTemplate.queryAsynchronously("select * from book where isbn='" + isbn + "'",

View Full Code Here

  }

  @Test
  public void queryAsynchronouslyWithListener() throws InterruptedException {

    QueryOptions options = new QueryOptions();
    options.setConsistencyLevel(ConsistencyLevel.ONE);
    options.setRetryPolicy(RetryPolicy.DEFAULT);

    final String isbn = "999999999";

    BookListener listener = new BookListener();
    cqlTemplate.queryAsynchronously("select * from book where isbn='" + isbn + "'", listener);
View Full Code Here

  }

  @Test
  public void queryAsynchronouslyWithListenerAndExecutor() throws InterruptedException {

    QueryOptions options = new QueryOptions();
    options.setConsistencyLevel(ConsistencyLevel.ONE);
    options.setRetryPolicy(RetryPolicy.DEFAULT);

    final String isbn = "999999999";

    BookListener listener = new BookListener();
View Full Code Here

  }

  @Test
  public void queryAsynchronouslyWithListenerAndExecutorAndOptions() throws InterruptedException {

    QueryOptions options = new QueryOptions();
    options.setConsistencyLevel(ConsistencyLevel.ONE);
    options.setRetryPolicy(RetryPolicy.DEFAULT);

    final String isbn = "999999999";

    BookListener listener = new BookListener();
View Full Code Here

  }

  @Test
  public void processTestResultSetRowCallbackHandlerWithAsyncOptions() {

    QueryOptions options = new QueryOptions();
    options.setConsistencyLevel(ConsistencyLevel.ONE);
    options.setRetryPolicy(RetryPolicy.DEFAULT);

    final String isbn = "999999999";

    final Book b1 = getBook(isbn);
View Full Code Here

  @Test
  public void deleteTest() {

    insertTest();

    QueryOptions options = new QueryOptions();
    options.setConsistencyLevel(ConsistencyLevel.ONE);
    options.setRetryPolicy(RetryPolicy.DOWNGRADING_CONSISTENCY);

    /*
     * Test Single Insert with entity
     */
    Book b1 = new Book();
View Full Code Here

TOP

Related Classes of org.springframework.cassandra.core.QueryOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.