Package org.hippoecm.repository.api
Interface HippoQuery
-
- All Superinterfaces:
Query
public interface HippoQuery extends Query
The HippoQuery is an extension to javax.jcr.query.Query to implement parameterized queries. Its interface is compliant with the upcoming standard of JCR2 (JSR-283) which leveraged the most important extension implemented; parameterized (stored) queries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bindValue(String varName, Value value)
QueryResult
execute(Map<String,String> arguments)
Convenience method to bind all arguments of a query using a single map and immediately execute the query.int
getArgumentCount()
This addition has no counterpart in JSR-283, JSR-283 only compliant applications have no means to query which parameters should be bound before a query can be executed.String[]
getArguments()
Session
getSession()
Obtains the session in which this query can be executed.Node
storeAsNode(String absPath, String type)
-
Methods inherited from interface javax.jcr.query.Query
execute, getBindVariableNames, getLanguage, getStatement, getStoredQueryPath, setLimit, setOffset, storeAsNode
-
-
-
-
Field Detail
-
HIPPOQL
static final String HIPPOQL
This query language is not yet available as public API, but reserved for future use.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSession
Session getSession() throws RepositoryException
Obtains the session in which this query can be executed.- Returns:
- the javax.jcr.Session associated with this Query instance
- Throws:
RepositoryException
- if a generic repossitory error occurs
-
storeAsNode
Node storeAsNode(String absPath, String type) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, UnsupportedRepositoryOperationException, RepositoryException
- Parameters:
absPath
-type
-- Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
UnsupportedRepositoryOperationException
RepositoryException
-
getArguments
String[] getArguments() throws RepositoryException
- Throws:
RepositoryException
-
getArgumentCount
int getArgumentCount() throws RepositoryException
This addition has no counterpart in JSR-283, JSR-283 only compliant applications have no means to query which parameters should be bound before a query can be executed. The extension of the HippoQuery class makes this possible.- Returns:
- the number of bindable parameters in the stored query
- Throws:
RepositoryException
- in case of an internal or connection error
-
execute
QueryResult execute(Map<String,String> arguments) throws RepositoryException
Convenience method to bind all arguments of a query using a single map and immediately execute the query. A JSR-283 only compliant application should use individual bindValue calls to bind each argument and then perform a no-argument execute call.- Parameters:
arguments
- a map of string keys of the free varia- Returns:
- the query result
- Throws:
RepositoryException
- in case of an internal or connection error
-
bindValue
void bindValue(String varName, Value value) throws IllegalArgumentException, RepositoryException
- Specified by:
bindValue
in interfaceQuery
- Parameters:
varName
-value
-- Throws:
IllegalArgumentException
RepositoryException
-
-