Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


oracle.webcenter.search
Class Query

java.lang.Object
  extended by oracle.webcenter.search.Query

All Implemented Interfaces:
java.io.Serializable

public class Query
extends java.lang.Object
implements java.io.Serializable

A Query captures all that is needed to perform a runtime query against a Search API implementation. A client will create a Query from a simple constructor. He will set the Query's Predicate when he has it available and then call "QueryExecutor.executeQuery(Query)" to return a QueryResult. The annotations using XmlAttribute and XmlElement will allow for a Query to be persisted into XML and also read from an XML source, using JAXB 2.0.

Since:
11.1.1.0.0 Beta 2
See Also:
Serialized Form

Nested Class Summary
static class Query.SortDirection
          The direction to perform the sort - either Ascending or Descending

 

Constructor Summary
Query()
          Empty constructor.

 

Method Summary
 void addLocation(java.lang.String location)
          Adds a starting path.
 Query cloneQuery()
           
 java.util.List<java.lang.String> getLocations()
          Return the starting paths for the search.
 Predicate getPredicate()
          The ComplexPredicate handles the joining of Conditions with ANDs and ORs.
 java.lang.String getScope()
          Retrieves a String scope value in which the search execution will take place.
 QName getSortBy()
          Gets the name of the attribute by which the results should be sorted.
 Query.SortDirection getSortDirection()
          Gets the Sorting direction of the Query results.
 void setLocations(java.util.List<java.lang.String> locations)
          Sets the starting paths.
 void setPredicate(Predicate queryPredicate)
          This sets the QueryPredicate value.
 void setScope(java.lang.String scope)
          Sets the scope of the Query.
 void setSortBy(QName sortBy)
          Sets the attribute name to sort results by.
 void setSortDirection(Query.SortDirection sortDirection)
          Sets the direction of the sort.
 java.lang.String toString()
          Renders the String representation of the Query object.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

Query

public Query()
Empty constructor.

Method Detail

getScope

public java.lang.String getScope()
Retrieves a String scope value in which the search execution will take place.
Returns:
a Scope object signifying the scope. The value may be null to indicate that scope is not part of the criteria. Implementors of the WPSAPI are expected to handle the case when the scope is null.

setScope

public void setScope(java.lang.String scope)
Sets the scope of the Query. Callers may invoke this with a null value to indicate that scope is not part of the criteria. Implementors of the WPSAPI are expected to handle the case when the scope is null.
Parameters:
scope - String scope for the query

setLocations

public void setLocations(java.util.List<java.lang.String> locations)
Sets the starting paths.
Parameters:
locations - an Iterator that states the starting paths for this query

addLocation

public void addLocation(java.lang.String location)
Adds a starting path.
Parameters:
location - a String path to add to the list of starting paths

getLocations

public java.util.List<java.lang.String> getLocations()
Return the starting paths for the search.
Returns:
a List of String locations specified for the Query

getPredicate

public Predicate getPredicate()
The ComplexPredicate handles the joining of Conditions with ANDs and ORs. The sub-ComplexPredicate allows for nesting of ANDs and ORs.
Returns:
the predicate held by this Query

setPredicate

public void setPredicate(Predicate queryPredicate)
This sets the QueryPredicate value.
Parameters:
queryPredicate - the query Predicate to be set.

getSortDirection

public Query.SortDirection getSortDirection()
Gets the Sorting direction of the Query results.
Returns:
SortDirection either Ascending or Descending

setSortDirection

public void setSortDirection(Query.SortDirection sortDirection)
Sets the direction of the sort.
Parameters:
sortDirection - QName representing the attribute name to sort by

getSortBy

public QName getSortBy()
Gets the name of the attribute by which the results should be sorted.
Returns:
QName representing the attribute name to sort by

setSortBy

public void setSortBy(QName sortBy)
Sets the attribute name to sort results by.
Parameters:
sortBy - QName representing the attribute name to sort by

toString

public java.lang.String toString()
Renders the String representation of the Query object.
Overrides:
toString in class java.lang.Object
Returns:
a String representing the Query object

cloneQuery

public Query cloneQuery()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved.