1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.jdbc.core;
  17. import java.util.List;
  18. /**
  19. * Extension of RowCallbackHandler interface that saves the accumulated results
  20. * as a List.
  21. *
  22. * <p>Allows to make a results list available in a uniform manner. JdbcTemplate's
  23. * query methods will return the results list in that case, else returning null
  24. * (-> result state is solely available from RowCallbackHandler object).
  25. *
  26. * <p>A convenient out-of-the-box implementation of ResultReader is the
  27. * RowMapperResultReader adapter which delegates row mapping to a RowMapper.
  28. * Note that a RowMapper object is typically stateless and thus reusable;
  29. * just the RowMapperResultReader adapter is stateful.
  30. *
  31. * @author Rod Johnson
  32. * @see RowMapperResultReader
  33. */
  34. public interface ResultReader extends RowCallbackHandler {
  35. /**
  36. * Return all results, disconnected from the JDBC ResultSet.
  37. * Never returns null; returns the empty collection if there
  38. * were no results.
  39. */
  40. List getResults();
  41. }