Class Restriction<T extends ObjectFilter>
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.query.restriction.Restriction<T>
-
- Direct Known Subclasses:
FullTextRestriction
,InOidRestriction
,ItemRestriction
,LogicalRestriction
,OrgRestriction
,TypeRestriction
public abstract class Restriction<T extends ObjectFilter> extends Object
An image of an ObjectFilter, forming a restriction tree. Preserves some state related to the interpretation (translation). Provides functionality related to the translation. As for the state, we maintain (or, more precisely, we are able to determine) the following: - base HQL property path for the restriction - base EntityDefinition for the restriction - chain of translation states that led to the starting HQL property path (if applicable) This is stored in baseHqlEntity. Most restrictions do not change the above properties when propagating them to their children. However, Type and Exists restrictions do. The former changes EntityDefinition, the latter all three. Also, item-related restrictions may, at their own discretion, use an EntityDefinition that points to a subclass of the one provided by the parent restriction. They do that if the item referenced (e.g. location) is not available in the provided entity (e.g. RObject or RFocus or RAbstractRole), but has to be found deeper. There is one known problem in this respect, though: locality attribute. It is present in UserType as well as in OrgType. So, if having query like ObjectType: Equals(locality, 'abc') it might be narrowed as o.localityUser or o.locality. (Maybe there are other attributes like that, I don't know.)- Author:
- lazyman, mederly
-
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull InterpretationContext
context
protected T
filter
protected Restriction
parent
-
Constructor Summary
Constructors Constructor Description Restriction(@NotNull InterpretationContext context, T filter, @NotNull JpaEntityDefinition baseEntityDefinition, Restriction parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description HqlEntityInstance
getBaseHqlEntity()
HqlEntityInstance
getBaseHqlEntityForChildren()
@NotNull InterpretationContext
getContext()
T
getFilter()
protected ItemPathResolver
getItemPathResolver()
Restriction
getParent()
abstract Condition
interpret()
protected boolean
isNegated()
protected String
nameOf(Enum e)
-
-
-
Field Detail
-
context
@NotNull protected final @NotNull InterpretationContext context
-
parent
protected final Restriction parent
-
filter
@NotNull protected final T extends ObjectFilter filter
-
-
Constructor Detail
-
Restriction
public Restriction(@NotNull @NotNull InterpretationContext context, @NotNull T filter, @NotNull @NotNull JpaEntityDefinition baseEntityDefinition, Restriction parent)
-
-
Method Detail
-
getFilter
@NotNull public T getFilter()
-
getContext
@NotNull public @NotNull InterpretationContext getContext()
-
getParent
public Restriction getParent()
-
getBaseHqlEntity
public HqlEntityInstance getBaseHqlEntity()
-
interpret
public abstract Condition interpret() throws QueryException
- Throws:
QueryException
-
isNegated
protected boolean isNegated()
-
getBaseHqlEntityForChildren
public HqlEntityInstance getBaseHqlEntityForChildren()
-
getItemPathResolver
protected ItemPathResolver getItemPathResolver()
-
-