Class QueryBuilder
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.query.builder.QueryBuilder
-
public final class QueryBuilder extends Object
Here is the language structure:Query ::= Filter? ('ASC(path)' | 'DESC(path)')* 'OFFSET(n)'? 'MAX-SIZE(n)'? Filter ::= 'ALL' | 'NONE' | 'UNDEFINED' | 'NOT' Filter | Filter ('AND'|'OR') Filter | 'BLOCK' Filter? 'END-BLOCK' | 'TYPE(type)' Filter? | 'EXISTS(path)' Filter? | 'REF(path, values*?)' Filter? | 'REFERENCED-BY(class, path, relation?)' Filter? | 'OWNED-BY(class, path?)' Filter? | 'FULLTEXT(value)' | 'ITEM(path)' ValueComparisonCondition | 'ITEM(path)' ItemComparisonCondition 'ITEM(path)' | 'ITEM(path)' 'IS-NULL' | 'ID(values)' | 'OWNER-ID(values)' | OrgFilter ValueComparisonCondition ::= 'EQ(value)' | 'GT(value)' | 'GE(value)' | 'LT(value)' | 'LE(value)' | 'STARTS-WITH(value)' | 'ENDS-WITH(value)' | 'CONTAINS(value)' | 'REF(value)' | 'ORG(value)' ItemComparisonCondition ::= 'EQ' | 'GT' | 'GE' | 'LT' | 'LE' OrgFilter ::= 'IS-ROOT' | 'IS-DIRECT-CHILD-OF(value)' | 'IS-CHILD-OF(value)' | 'IS-PARENT-OF(value)' | 'IS-IN-SCOPE-OF(value, scope)'
It can be visualized e.g. using https://www.bottlecaps.de/rr/ui Individual keywords ('AND', 'OR', 'BLOCK', ...) are mapped to methods. Connections between these keywords are mapped to interfaces. It can be viewed as interfaces = states, keywords = transitions. (Or vice versa, but this is more natural.) The interfaces have names starting with S_ (for "state"). Interfaces are implemented by classes that aggregate state of the query being created. This is quite hacked for now... to be implemented more seriously.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PrismContext
getPrismContext()
static S_FilterEntryOrEmpty
queryFor(Class<? extends Containerable> queryClass, PrismContext prismContext)
static S_FilterEntryOrEmpty
queryFor(Class<? extends Containerable> queryClass, PrismContext prismContext, ItemDefinitionResolver itemDefinitionResolver)
static S_FilterEntryOrEmpty
queryForReferenceOwnedBy(Class<? extends Containerable> ownerClass, ItemPath referencePath, PrismContext prismContext)
Creates a builder for reference search defined by specified owner and reference path.
-
-
-
Method Detail
-
getPrismContext
@NotNull public @NotNull PrismContext getPrismContext()
-
queryFor
public static S_FilterEntryOrEmpty queryFor(Class<? extends Containerable> queryClass, PrismContext prismContext, ItemDefinitionResolver itemDefinitionResolver)
-
queryFor
public static S_FilterEntryOrEmpty queryFor(Class<? extends Containerable> queryClass, PrismContext prismContext)
-
queryForReferenceOwnedBy
public static S_FilterEntryOrEmpty queryForReferenceOwnedBy(Class<? extends Containerable> ownerClass, ItemPath referencePath, PrismContext prismContext)
Creates a builder for reference search defined by specified owner and reference path. This creates the necessary owned-by filter and one can immediately write owner nested filter, or continue withS_FilterExit.and()
to add additional ref filter for self path, or finish the query withS_QueryExit.build()
.
-
-