| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| CountAwareQueryResults |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2011 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php | |
| 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.kuali.rice.core.api.criteria; | |
| 17 | ||
| 18 | ||
| 19 | /** | |
| 20 | * Indicates a set of {@link QueryResults} which provide information related to | |
| 21 | * the count of rows returned by the query as well as whether or not the query | |
| 22 | * returned all available results. | |
| 23 | * | |
| 24 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 25 | * | |
| 26 | */ | |
| 27 | public interface CountAwareQueryResults<T> extends QueryResults<T> { | |
| 28 | ||
| 29 | /** | |
| 30 | * Gets the total number of records that match the executed query. Note | |
| 31 | * that this number will not necessarily match the number of results | |
| 32 | * returned by {@link #getResults()} as the query may cut off the number | |
| 33 | * of records returned by the actual query request. In these cases, the | |
| 34 | * total row count represents the total number of results which would be | |
| 35 | * returned by the query if there was no cap on the results returned (i.e. | |
| 36 | * the equivalent of the result of a "count" query in SQL). | |
| 37 | * | |
| 38 | * <p>The total row count is optional depending on whether or not the | |
| 39 | * client requested the total row count when invoking the query. It's also | |
| 40 | * possible that the query is unable to produce a total row count depending | |
| 41 | * on the back-end implementation, in which cases this value will also not | |
| 42 | * be available. | |
| 43 | * | |
| 44 | * @return the total number of rows, or null if the total row count was not | |
| 45 | * requested by the query or could not be determined | |
| 46 | */ | |
| 47 | Integer getTotalRowCount(); | |
| 48 | ||
| 49 | /** | |
| 50 | * Indicates if there are more results available for the query immediately | |
| 51 | * following the last result that was returned. In this case, the records | |
| 52 | * returned in {@link #getResults()} will not include the complete result | |
| 53 | * set for the query. This could be because the query only requested a | |
| 54 | * certain number of rows, or that the query couldn't return the number | |
| 55 | * of rows that were requested. | |
| 56 | * | |
| 57 | * <p>It is intended that this value be used to facilitate paging or | |
| 58 | * reporting in the client in cases where that is desired. | |
| 59 | * | |
| 60 | * @return true if there are more results available for the query, false otherwise | |
| 61 | */ | |
| 62 | boolean isMoreResultsAvailable(); | |
| 63 | ||
| 64 | } |