|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MagnoliaQueryOperations
Specifies a basic set of Magnolia query operations. Implemented by MagnoliaTemplate
. Not often used directly,
but a useful option to enhance testability, as it can easily be mocked or stubbed.
MagnoliaTemplate
Method Summary | ||
---|---|---|
|
queryForList(String repository,
String query,
String language,
String type,
ContentMapper<T> mapper)
Execute a query for a result list of type T, for the given query. |
|
|
queryForObject(String repository,
String query,
String language,
String type,
ContentMapper<T> mapper)
Execute a query for a single or null result object, for the given query. |
|
javax.jcr.Node |
xpathQueryForContent(String repository,
String query,
String type)
Execute an XPath query for a Content node. |
|
|
xpathQueryForList(String repository,
String query,
String type,
ContentMapper<T> mapper)
Execute an XPath query for a result list of type T, for the given query. |
|
|
xpathQueryForObject(String repository,
String query,
String type,
ContentMapper<T> mapper)
Execute an XPath query for a single or null result object, for the given query. |
Method Detail |
---|
<T> T queryForObject(String repository, String query, String language, String type, ContentMapper<T> mapper) throws DataAccessException
null
result object, for the given query. This method is useful for
running queries with a known outcome. The query is expected to be a single result query; the returned result will
be directly mapped to the corresponding object type.
repository
- the repository to execute query againstquery
- query to executelanguage
- query language (either XPATH
or SQL
).type
- the type of the item to query formapper
- the mapper used
null
in case of a null
query
IncorrectResultSizeDataAccessException
- if the query returns more than one results
DataAccessException
- if there is any problem executing the query<T> List<T> queryForList(String repository, String query, String language, String type, ContentMapper<T> mapper) throws DataAccessException
repository
- the repository to execute query againstquery
- query to executelanguage
- query language (either XPATH
or SQL
).type
- the type of the item to query formapper
- the mapper used
null
in case of a null
query
DataAccessException
- if there is any problem executing the query<T> T xpathQueryForObject(String repository, String query, String type, ContentMapper<T> mapper) throws DataAccessException
null
result object, for the given query. This method is
useful for running queries with a known outcome. The query is expected to be a single result query; the returned
result will be directly mapped to the corresponding object type.
repository
- the repository to execute query againstquery
- query to executetype
- the type of the item to query formapper
- the mapper used
null
in case of a null
query
IncorrectResultSizeDataAccessException
- if the query returns more than one results
DataAccessException
- if there is any problem executing the query<T> List<T> xpathQueryForList(String repository, String query, String type, ContentMapper<T> mapper) throws DataAccessException
repository
- the repository to execute query againstquery
- query to executetype
- the type of the item to query formapper
- the mapper used
null
in case of a null
Xpath query
DataAccessException
- if there is any problem executing the queryjavax.jcr.Node xpathQueryForContent(String repository, String query, String type) throws DataAccessException
repository
- the repository to execute query againstquery
- query to executetype
- the type of the item to query for
null
if no such node exists
DataAccessException
- if there is any problem executing the query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |