Package com.adobe.granite.rest.query
Interface QueryTransformer
-
@ConsumerType public interface QueryTransformer
Defines a service interface which might be asked to transform an arbitrary string into a valid JCR-SQL2 query.A custom query language string might be translated from:
SELECT page WHERE dc:description LIKE 'foo%' ORDER BY dc:title
into the corresponding valid JCR-SQL2 query:
SELECT page.* FROM [cq:Page] AS page INNER JOIN [cq:PageContent] AS child ON ISCHILDNODE(child, page) WHERE child.[jcr:description] LIKE 'foo' AND ISDESCENDANTNODE(page, [/content]) ORDER BY child.[jcr:title]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
transform(Resource resource, java.lang.String customquery)
Transforms the specifiedcustomquery
to a valid JCR-SQL2 query.
-
-
-
Method Detail
-
transform
java.lang.String transform(Resource resource, java.lang.String customquery) throws RestException
Transforms the specifiedcustomquery
to a valid JCR-SQL2 query. Thecustomquery
is meant to be applied as the specifiedresource
as the search path.- Parameters:
resource
- Resource to search incustomquery
- Custom query string- Returns:
- A valid JCR-SQL2 query string
- Throws:
RestException
- If an error occurs during transformation
-
-