Package com.datastax.driver.core

Examples of com.datastax.driver.core.Row


        if (tracer != null) {
            tracer.onReadResultSetBegin(session, entity, resultSet, columns);
        }
        GettableRetriever retriever = new GettableRetriever(session.persistenceManager.protocolVersion, columns);
        while (!resultSet.isExhausted()) {
            Row row = resultSet.one();
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("got {} row for read of {}", row != null ? "a" : "no", entity.type);
            }
            retriever.setCurrentSource(row);
            if (tracer != null) {
View Full Code Here


        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Lazy load of {} attributes for {}", attrs.length, type);
        }

        ResultSet resultSet = session.execute(bStmt);
        Row row = resultSet.one();
        if (row != null) {
            Retriever retriever = new GettableRetriever(persistenceSession.persistenceManager.protocolVersion, row, loadColumns);
            for (MappedAttribute attr : attrs) {
                Object instance = resolveParentInstance(container, attr);
                if (LOGGER.isDebugEnabled()) {
View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Lazy load of {} attributes for {}", attrs.length, type);
        }

        ResultSet resultSet = session.execute(bStmt);
        Row row = resultSet.one();
        if (row != null) {
            Retriever retriever = new GettableRetriever(persistenceSession.persistenceManager.protocolVersion, row, loadColumns);
            for (MappedAttribute attr : attrs) {
                Object instance = resolveParentInstance(container, attr);
                if (LOGGER.isDebugEnabled()) {
View Full Code Here

        @SuppressWarnings("unchecked") @Override public void run() {
            try {
                ResultSet rs = delegate.get();
                if (!rs.isExhausted()) {
                    Row row = rs.one();
                    boolean applied = row.getBool("[applied]");
                    if (!applied) {
                        for (BatchPartFutureImpl future : futures) {
                            future.setException(new CasNotAppliedException(future.entity, future.instance, future.mode, row));
                        }
                        setException(new CasNotAppliedException(null, null, null, row));
View Full Code Here

    void test() throws InterruptedException {
      Book expected = insert(1)[0];
      BasicListener listener = new BasicListener();
      doAsyncQuery(expected, listener);
      listener.await();
      Row r = t.getResultSetUninterruptibly(listener.rsf).one();
      Book actual = new Book(r.getString(0), r.getString(1));
      assertBook(expected, actual);
    }
View Full Code Here

  @Override
  public <T> T processOne(ResultSet resultSet, Class<T> requiredType) throws DataAccessException {
    if (resultSet == null) {
      return null;
    }
    Row row = resultSet.one();
    if (row == null) {
      return null;
    }
    return (T) firstColumnToObject(row);
  }
View Full Code Here

    return query(select, new ResultSetExtractor<Long>() {

      @Override
      public Long extractData(ResultSet rs) throws DriverException, DataAccessException {

        Row row = rs.one();
        if (row == null) {
          throw new InvalidDataAccessApiUsageException(String.format("count query did not return any results"));
        }

        return row.getLong(0);
      }
    });
  }
View Full Code Here

  @Override
  public void onQueryComplete(ResultSetFuture rsf) {
    countDown();

    Row row;
    try {
      row = rsf.get().one();
    } catch (Exception e) {
      throw new RuntimeException("Failed to get ResultSet from ResultSetFuture", e);
    }
    book = new Book();
    book.setIsbn(row.getString("isbn"));
    book.setTitle(row.getString("title"));
    book.setAuthor(row.getString("author"));
    book.setPages(row.getInt("pages"));

    done = true;
  }
View Full Code Here

    Book b1 = cqlTemplate.query("select * from book where isbn='" + isbn + "'", new ResultSetExtractor<Book>() {

      @Override
      public Book extractData(ResultSet rs) throws DriverException, DataAccessException {
        Row r = rs.one();
        assertNotNull(r);

        Book b = rowToBook(r);

        return b;
View Full Code Here

    new ResultSetExtractor<Book>() {

      @Override
      public Book extractData(ResultSet rs) throws DriverException, DataAccessException {
        Row r = rs.one();
        assertNotNull(r);

        Book b = rowToBook(r);

        return b;
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.Row

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.