PREV CLASS
NEXT CLASS
com.ibm.workplace.wcm.api.query
Class Negation
java.lang.Object
com.ibm.workplace.wcm.api.query.Negation
- All Implemented Interfaces:
- QueryElement, Selector, java.io.Serializable
-
public final class Negation
- extends java.lang.Object
- implements Selector
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);
- Since:
- 8.0
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Negation
public Negation()
- Constructor
Negation
public Negation(Selector selector)
- Constructor
- Parameters:
- selector - associated selector
set
public void set(Selector selector)
- Sets the selector
- Parameters:
- selector - the selector to set
getSelector
public Selector getSelector()
- Get the selector
- Returns:
- the current selector
hasElements
public boolean hasElements()
- Specified by:
- hasElements in interface QueryElement
getElements
public java.util.List<? extends QueryElement> getElements()
- Specified by:
- getElements in interface QueryElement
PREV CLASS
NEXT CLASS