|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions
public final class Restrictions
The criterion package may be used by applications as a framework for building new kinds of Criterion. However, it is intended that most applications will simply use the built-in criterion types via the static factory methods of this class.
| Method Summary | |
|---|---|
static LogicalExpression |
and(Criterion lhs,
Criterion rhs)
Return the conjuction of two expressions |
static Criterion |
between(String nodeName,
Object lo,
Object hi)
Apply a "between" constraint to the named node |
static Criterion |
betweenDates(String nodeName,
Calendar lo,
Calendar hi)
Adds a date contraint: the input date must be included in the given dates (between 00:00 of the first date to 23:59 of the last date) |
static Conjunction |
conjunction()
Group expressions together in a single conjunction (A and B and C...) |
static JCRFunctionExpression |
contains(String nodeName,
Object value)
Apply a "contains" constraint to the named node. |
static JCRFunctionExpression |
contains(String nodeName,
Object value,
boolean escape)
Apply a "contains" constraint to the named node. |
static Disjunction |
disjunction()
Group expressions together in a single disjunction (A or B or C...) |
static SimpleExpression |
eq(String nodeName,
Object value)
Apply an "equal" constraint to the named node |
static Criterion |
eqDate(String nodeName,
Calendar value)
Adds a date contraint: the input date must be included in the given date, excluding time (between 00:00 and 23:59 of the given date) |
static SimpleExpression |
ge(String nodeName,
Object value)
Apply a "greater than or equal" constraint to the named node |
static SimpleExpression |
gt(String nodeName,
Object value)
Apply a "greater than" constraint to the named node |
static Criterion |
in(String nodeName,
Collection<String> values)
Apply an "in" constraint to the named node |
static Criterion |
in(String nodeName,
String[] values)
Apply an "in" constraint to the named node |
static Criterion |
isNotNull(String nodeName)
Apply an "is not null" constraint to the named node |
static Criterion |
isNull(String nodeName)
Apply an "is null" constraint to the named node |
static SimpleExpression |
le(String nodeName,
Object value)
Apply a "less than or equal" constraint to the named node |
static JCRFunctionExpression |
like(String nodeName,
Object value)
Apply a "like" constraint of type MatchMode.ANYWHERE to the named node Be warned when using jcr:like function, as it can be very slow. The following account of why it is so, was taken from users@jackrabbit.apache.org mailing list Question: My xpath is '//*[jcr:like(@propertyName, '%somevalue%')]' and it takes minutes to complete. |
static JCRFunctionExpression |
like(String nodeName,
Object value,
MatchMode matchMode)
Apply a "like" constraint to the named node Be warned when using jcr:like function, as it can be very slow. The following account of why it is so, was taken from users@jackrabbit.apache.org mailing list Question: My xpath is '//*[jcr:like(@propertyName, '%somevalue%')]' and it takes minutes to complete. |
static SimpleExpression |
lt(String nodeName,
Object value)
Apply a "less than" constraint to the named node |
static SimpleExpression |
ne(String nodeName,
Object value)
Apply a "not equal" constraint to the named node |
static Criterion |
not(Criterion expression)
Return the negation of an expression |
static LogicalExpression |
or(Criterion lhs,
Criterion rhs)
Return the disjuction of two expressions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SimpleExpression eq(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number or Calendar.
public static SimpleExpression ne(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number or Calendar.
public static JCRFunctionExpression like(String nodeName,
Object value)
MatchMode.ANYWHERE to the named node
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number.
public static JCRFunctionExpression like(String nodeName,
Object value,
MatchMode matchMode)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number.matchMode - - one of MatchMode.START or MatchMode.END or MatchMode.ANYWHERE
public static JCRFunctionExpression contains(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number.
public static JCRFunctionExpression contains(String nodeName,
Object value,
boolean escape)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number.escape - - if true, value will be escaped, avoiding JCRQueryException on query execution
public static SimpleExpression gt(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number or Calendar.
public static SimpleExpression lt(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number or Calendar.
public static SimpleExpression le(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number or Calendar.
public static SimpleExpression ge(String nodeName,
Object value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - - must be an instance of either String or Number or Calendar.
public static Criterion between(String nodeName,
Object lo,
Object hi)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)lo - value - must be an instance of either String or Number or Calendar.hi - value - must be an instance of either String or Number or Calendar.
public static Criterion eqDate(String nodeName,
Calendar value)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)value - date (time will be ignored)
public static Criterion betweenDates(String nodeName,
Calendar lo,
Calendar hi)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)lo - lower datehi - higher date
public static Criterion in(String nodeName,
String[] values)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)values - - a String[]
public static Criterion in(String nodeName,
Collection<String> values)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)values - - a collection of String
public static Criterion isNull(String nodeName)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)
public static Criterion isNotNull(String nodeName)
nodeName - - String a qualified (eg. nt:somenode) or unqualified (eg. somenode) node name. When a node is an
attribute it must be preceded by the '@'character (eg. @nt:somenode)
public static LogicalExpression and(Criterion lhs,
Criterion rhs)
lhs - left expressionrhs - right expression
public static LogicalExpression or(Criterion lhs,
Criterion rhs)
lhs - left expressionrhs - right expression
public static Criterion not(Criterion expression)
expression - to be negated
public static Conjunction conjunction()
public static Disjunction disjunction()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||