Package javax.jcr.query
Interface QueryManager
-
public interface QueryManager
This interface encapsulates methods for the management of search queries. Provides methods for the creation and retrieval of search queries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Query
createQuery(java.lang.String statement, java.lang.String language)
Creates a new query by specifying the querystatement
itself and thelanguage
in which the query is stated.QueryObjectModelFactory
getQOMFactory()
Returns aQueryObjectModelFactory
with which a JCR-JQOM query can be built programmatically.Query
getQuery(Node node)
Retrieves an existing persistent query.java.lang.String[]
getSupportedQueryLanguages()
Returns an array of strings representing all query languages supported by this repository.
-
-
-
Method Detail
-
createQuery
Query createQuery(java.lang.String statement, java.lang.String language) throws InvalidQueryException, RepositoryException
Creates a new query by specifying the querystatement
itself and thelanguage
in which the query is stated. Thelanguage
must be a string from among those returned by QueryManager.getSupportedQueryLanguages().- Parameters:
statement
- aString
language
- aString
- Returns:
- a
Query
object - Throws:
InvalidQueryException
- if the query statement is syntactically invalid or the specified language is not supported.RepositoryException
- if another error occurs.
-
getQOMFactory
QueryObjectModelFactory getQOMFactory()
Returns aQueryObjectModelFactory
with which a JCR-JQOM query can be built programmatically.- Returns:
- a
QueryObjectModelFactory
object - Since:
- JCR 2.0
-
getQuery
Query getQuery(Node node) throws InvalidQueryException, RepositoryException
Retrieves an existing persistent query.Persistent queries are created by first using
createQuery(java.lang.String, java.lang.String)
to create aQuery
object and then callingQuery.save
to persist the query to a location in the workspace.- Parameters:
node
- a persisted query (that is, a node of typent:query
).- Returns:
- a
Query
object. - Throws:
InvalidQueryException
- Ifnode
is not a valid persisted query (that is, a node of typent:query
).RepositoryException
- if another error occurs
-
getSupportedQueryLanguages
java.lang.String[] getSupportedQueryLanguages() throws RepositoryException
Returns an array of strings representing all query languages supported by this repository. This set must include at least the strings represented by the constantsQuery.JCR_SQL2
andQuery.JCR_JQOM
}. An implementation may also support other languages, including the deprecated languages of JCR 1.0:Query.XPATH
andQuery.SQL
.- Returns:
- A string array.
- Throws:
RepositoryException
- if an error occurs.
-
-