org.kuali.rice.core.api.criteria
Class QueryByCriteria

java.lang.Object
  extended by org.kuali.rice.core.api.mo.AbstractDataTransferObject
      extended by org.kuali.rice.core.api.criteria.QueryByCriteria
All Implemented Interfaces:
Serializable, ModelObjectBasic, ModelObjectComplete

public final class QueryByCriteria
extends AbstractDataTransferObject

Defines a criteria-based query. Consists of a Predicate definition as well as a set of additional properties which control paging and other aspects of the results which should be returned from the query.

In order to construct a new QueryByCriteria, the QueryByCriteria.Builder should be used. Use the PredicateFactory to construct the predicate for use by the query.

This class specifies nothing regarding how the query will be executed. It is expected that an instance will be constructed and then passed to code which understands how to execute the desired query.

This class is mapped for use by JAXB and can therefore be used by clients as part of remotable service definitions.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Predicate, PredicateFactory, Serialized Form

Nested Class Summary
static class QueryByCriteria.Builder
           
 
Method Summary
 CountFlag getCountFlag()
          Indicates whether or not a total row count should be returned with the query.
 Integer getMaxResults()
          Returns the maximum number of results that this query is requesting to receive.
 Predicate getPredicate()
          Returns the Predicate which will be used to execute the query.
 Integer getStartAtIndex()
          Returns the optional zero-based "start" index for rows returned.
 
Methods inherited from class org.kuali.rice.core.api.mo.AbstractDataTransferObject
afterUnmarshal, beforeUnmarshal, equals, equalsExcludeFields, getDefaultHashCodeEqualsExcludeFields, hashCode, hashCodeExcludeFields, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getPredicate

public Predicate getPredicate()
Returns the Predicate which will be used to execute the query.

Returns:
can be null if no predicate was specified

getStartAtIndex

public Integer getStartAtIndex()
Returns the optional zero-based "start" index for rows returned. When this query is executed, this property should be read to determine the first row which should be returned. If the given index is beyond the end of the result set, then the resulting query should effectively return no rows (as opposed to producing an index-based out of bounds error). If the value is null, then the results should start with the first row returned from the query.

Will never be less than 0

Returns:
the starting row index requested by this query, or null if the results should start at the beginning of the result set

getMaxResults

public Integer getMaxResults()
Returns the maximum number of results that this query is requesting to receive. If null, then the query should return all rows, or as many as it can. If the number request is larger than the number of results then all results are returned.

Will never be less than 0

Returns:
the maximum number of results to return from the query

getCountFlag

public CountFlag getCountFlag()
Indicates whether or not a total row count should be returned with the query. See CountFlag for more information on what each of these flags means. This will never return null and defaults to CountFlag.NONE.

Returns:
the flag specifying whether or not a total row count should be produced by the query


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.