public class QueryUtil extends Object
Constructor and Description |
---|
QueryUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
buildQuery(String statement,
String startPath)
Creates a simple SQL2 query statement.
|
static String |
createDateExpression(Calendar calendar)
Deprecated.
since 4.5.4 use info.magnolia.cms.util.DateUtil.createDateExpression(calendar)
|
static String |
createDateExpression(int year,
int month,
int day)
Deprecated.
|
static String |
createDateTimeExpression(Calendar calendar)
Deprecated.
since 4.5.4 use info.magnolia.cms.util.DateUtil.createDateTimeExpression(calendar)
|
static String |
createDateTimeExpression(int year,
int month,
int day,
int hour,
int minutes,
int seconds)
Deprecated.
|
static String |
createDateTimeExpressionIgnoreTimeZone(Calendar calendar)
Deprecated.
since 4.5.4 use info.magnolia.cms.util.DateUtil.createDateTimeExpressionIgnoreTimeZone(calendar)
|
static String |
createDateTimeExpressionIgnoreTimeZone(int year,
int month,
int day,
int hour,
int minutes,
int seconds)
Deprecated.
|
static javax.jcr.NodeIterator |
search(javax.jcr.query.qom.QueryObjectModel model,
String returnItemType)
Executes the query based on QOM and then pops-up in the node hierarchy until returnItemType is found.
|
static javax.jcr.NodeIterator |
search(String workspace,
String statement)
Executes the query using JCR SQL2 language.
|
static javax.jcr.NodeIterator |
search(String workspace,
String statement,
String language)
Executes the query with given language.Unlike in the old API item type has to be specified in query itself.
|
static javax.jcr.NodeIterator |
search(String workspace,
String statement,
String language,
String returnItemType)
Searches for statement and then pops-up in the node hierarchy until returnItemType is found.
|
static javax.jcr.NodeIterator |
search(String workspace,
String statement,
String language,
String returnItemType,
boolean isSelector)
Searches for statement and then pops-up in the node hierarchy until returnItemType is found.
|
@Deprecated public static String createDateExpression(int year, int month, int day)
month
- 1-12 (as opposed to java.util.Calendar 0-11 notation)@Deprecated public static String createDateExpression(Calendar calendar)
@Deprecated public static String createDateTimeExpression(int year, int month, int day, int hour, int minutes, int seconds)
month
- 1-12 (as opposed to java.util.Calendar 0-11 notation)@Deprecated public static String createDateTimeExpression(Calendar calendar)
@Deprecated public static String createDateTimeExpressionIgnoreTimeZone(int year, int month, int day, int hour, int minutes, int seconds)
month
- 1-12 (as opposed to java.util.Calendar 0-11 notation)@Deprecated public static String createDateTimeExpressionIgnoreTimeZone(Calendar calendar)
public static javax.jcr.NodeIterator search(javax.jcr.query.qom.QueryObjectModel model, String returnItemType) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
DateUtil.create*Expression()
methods.javax.jcr.query.InvalidQueryException
javax.jcr.RepositoryException
public static javax.jcr.NodeIterator search(String workspace, String statement, String language) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
SELECT * FROM [mgnl:page]
example for selecting just pages in JCR SQL2 language.
Duplicate nodes are removed from result.
For date/time expressions use DateUtil.create*Expression()
methods.javax.jcr.query.InvalidQueryException
javax.jcr.RepositoryException
public static javax.jcr.NodeIterator search(String workspace, String statement) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
SELECT * FROM [mgnl:page]
example for selecting just pages.
For executing old query use info.magnolia.cms.util.QueryUtil.search(String workspace, String statement, String language)
where you specify Query.SQL
as the language.
For date/time expressions use DateUtil.create*Expression()
methods.javax.jcr.query.InvalidQueryException
javax.jcr.RepositoryException
public static javax.jcr.NodeIterator search(String workspace, String statement, String language, String returnItemType) throws javax.jcr.LoginException, javax.jcr.RepositoryException
DateUtil.create*Expression()
methods.javax.jcr.LoginException
javax.jcr.RepositoryException
public static javax.jcr.NodeIterator search(String workspace, String statement, String language, String returnItemType, boolean isSelector) throws javax.jcr.RepositoryException
DateUtil.create*Expression()
methods.javax.jcr.RepositoryException
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.