org.mmbase.storage.search
Interface SearchQuery

All Superinterfaces:
Cacheable
All Known Subinterfaces:
NodeQuery, Query
All Known Implementing Classes:
AbstractQueryWrapper, BasicNodeQuery, BasicQuery, BasicSearchQuery, ModifiableQuery, NodeQueryWrapper, NodeSearchQuery, NodeSearchQuery, QueryWrapper

public interface SearchQuery
extends Cacheable

Encapsulates a request for a search of the object cloud.

This corresponds to a SELECT query in SQL syntax.

Since:
MMBase-1.7
Version:
$Id: SearchQuery.java 41186 2010-02-26 17:54:31Z michiel $
Author:
Rob van Maris

Field Summary
static int DEFAULT_MAX_NUMBER
          Default maxNumber value, corresponds to no maximum.
static int DEFAULT_OFFSET
          Default offset value, corresponds to no offset.
 
Method Summary
 boolean equals(Object obj)
          Compares this query to the specified object.
 Constraint getConstraint()
          Gets the constraints on the search results.
 List<StepField> getFields()
          Gets the stepfields in the search request.
 int getMaxNumber()
          Gets the maximum number of results to be returned, or -1 if the number of results to be returned is unlimited.
 int getOffset()
          Gets the (zerobased) offset in the list of results, of the first result to return.
 List<SortOrder> getSortOrders()
          Gets the SortOrder objects in the order they are to be applied.
 List<Step> getSteps()
          Gets the steps in the search request.
 int hashCode()
           
 boolean isAggregating()
          Tests if this is an aggregating query, i.e.
 boolean isDistinct()
          Tests if the search request is to return distinct results.
 boolean markUsed()
           
 String toString()
          Returns a string representation of this SearchQuery.
 
Methods inherited from interface org.mmbase.cache.Cacheable
getCachePolicy, setCachePolicy
 

Field Detail

DEFAULT_MAX_NUMBER

static final int DEFAULT_MAX_NUMBER
Default maxNumber value, corresponds to no maximum.

See Also:
getMaxNumber(), Constant Field Values

DEFAULT_OFFSET

static final int DEFAULT_OFFSET
Default offset value, corresponds to no offset.

See Also:
getOffset(), Constant Field Values
Method Detail

isDistinct

boolean isDistinct()
Tests if the search request is to return distinct results. In that case duplicate nodes will be removed from the result.

This corresponds to the use of "DISTINCT" in SQL SELECT-syntax .


isAggregating

boolean isAggregating()
Tests if this is an aggregating query, i.e. containing aggregated fields.


getSteps

List<Step> getSteps()
Gets the steps in the search request.

This corresponds to the tables in SQL SELECT-syntax.


getFields

List<StepField> getFields()
Gets the stepfields in the search request.

This corresponds to the fields in SQL SELECT-syntax.


getConstraint

Constraint getConstraint()
Gets the constraints on the search results.

This corresponds to (part of) the constraints in the WHERE-clause in SQL SELECT-syntax.


getMaxNumber

int getMaxNumber()
Gets the maximum number of results to be returned, or -1 if the number of results to be returned is unlimited.

Note: limiting the number of results may not be supported by the database layer.


getOffset

int getOffset()
Gets the (zerobased) offset in the list of results, of the first result to return. Note that, since it is zerobased, it is equal to the number of results that are skipped.

Note: skipping results may not be supported by the database layer.


getSortOrders

List<SortOrder> getSortOrders()
Gets the SortOrder objects in the order they are to be applied. This specifies the sorting order of the search results.

This corresponds to the ORDER BY clause in SQL SELECT syntax.


equals

boolean equals(Object obj)
Compares this query to the specified object. The result is true if and only if the argument is a non-null SearchQuery object representing the same query.

Overrides:
equals in class Object
Parameters:
obj - The object to compare with.
Returns:
true if the objects are equal, false otherwise.

hashCode

int hashCode()
Overrides:
hashCode in class Object

toString

String toString()
Returns a string representation of this SearchQuery. The string representation has the form "SearchQuery(distinct:<distinct>, steps:<steps>, fields:<fields>, constraint:<constraint>, sortorders:<sortorders>, max:<max>, offset:<offset>)" where

Overrides:
toString in class Object
Returns:
A string representation of this SearchQuery.

markUsed

boolean markUsed()
Since:
MMBase-1.9.2


MMBase 2.0-SNAPSHOT - null