|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.workplace.wcm.api.query.Negation
public final class Negation
Negation
inverts a selector.
Note that Negation may prevent the database from efficiently using indexes and therefore may perform slowly.
It should therefore only be used if necessary.
Example use of Negation
with Conjunction
and Disjunction
Query query = queryService.createQuery(Content.class); Disjunction or = new Disjunction(); or.add(Selectors.nameLike("news%")); Negation not = new Negation(ProfileSelectors.keywordsContain("news")); Conjunction and = new Conjunction(); and.add(Selectors.nameLike("article%")); and.add(not); or.add(and); query.addSelector(or);
Field Summary |
---|
Fields inherited from interface com.ibm.workplace.wcm.api.query.Selector |
---|
NULL_SELECTOR |
Constructor Summary | |
---|---|
Negation()
Constructor |
|
Negation(Selector selector)
Constructor |
Method Summary | |
---|---|
java.util.List<? extends QueryElement> |
getElements()
|
Selector |
getSelector()
Get the selector |
boolean |
hasElements()
|
void |
set(Selector selector)
Sets the selector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Negation()
public Negation(Selector selector)
selector
- associated selectorMethod Detail |
---|
public void set(Selector selector)
selector
- the selector to setpublic Selector getSelector()
public boolean hasElements()
hasElements
in interface QueryElement
public java.util.List<? extends QueryElement> getElements()
getElements
in interface QueryElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |