|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.util.QueryUtil
public class QueryUtil
Util to execute queries as simple as possible.
Constructor Summary | |
---|---|
QueryUtil()
|
Method Summary | |
---|---|
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 Collection<Content> |
exceptionThrowingQuery(String repository,
String statement,
String language,
String returnItemType)
Deprecated. Since 4.5.4 use search methods. |
static Collection<Content> |
exceptionThrowingQuery(String repository,
String statement,
String language,
String returnItemType,
long maxResultSize)
Deprecated. Since 4.5.4 use search methods. |
static Collection<Content> |
query(String repository,
String statement)
Deprecated. Since 4.5.4 use search methods. |
static Collection<Content> |
query(String repository,
String statement,
String language)
Deprecated. Since 4.5.4 use search methods. |
static Collection<Content> |
query(String repository,
String statement,
String language,
String returnItemType)
Deprecated. Since 4.5.4 use search methods. |
static Collection<Content> |
query(String repository,
String statement,
String language,
String returnItemType,
long maxResultSize)
Deprecated. Since 4.5.4 use search methods. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueryUtil()
Method Detail |
---|
public static Collection<Content> query(String repository, String statement)
public static Collection<Content> query(String repository, String statement, String language)
public static Collection<Content> exceptionThrowingQuery(String repository, String statement, String language, String returnItemType) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static Collection<Content> exceptionThrowingQuery(String repository, String statement, String language, String returnItemType, long maxResultSize) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static Collection<Content> query(String repository, String statement, String language, String returnItemType)
public static Collection<Content> query(String repository, String statement, String language, String returnItemType, long maxResultSize)
public static String createDateExpression(int year, int month, int day)
month
- 1-12 (as opposed to java.util.Calendar 0-11 notation)public static String createDateExpression(Calendar calendar)
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)public static String createDateTimeExpression(Calendar calendar)
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)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.
model
- returnItemType
-
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.
workspace
- statement
- language
-
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.
workspace
- statement
-
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.
workspace
- statement
- language
- returnItemType
-
javax.jcr.LoginException
javax.jcr.RepositoryException
public static String buildQuery(String statement, String startPath)
statement
- startPath
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |