Class QueryInterpreter
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.query.QueryInterpreter
-
public class QueryInterpreter extends Object
Interprets midPoint queries by translating them to hibernate (HQL) ones. There are two parts: - filter translation, - paging translation. As for filter translation, we traverse the filter depth-first, creating an isomorphic structure of Restrictions. While creating them, we continually build a set of entity references that are necessary to evaluate the query; these references are in the form of cartesian join of entities from which each one can have a set of entities connected to it via left outer join. An example: from RUser u left join u.assignments a with ... left join u.organization o, RRole r left join r.assignments a2 with ... This structure is maintained in InterpretationContext, namely in the HibernateQuery being prepared. (In order to produce HQL, we use ad-hoc "hibernate query model" in hqm package, rooted in HibernateQuery class.) Paging translation is done after filters are translated. It may add some entity references as well, if they are not already present.- Author:
- lazyman, mederly
-
-
Constructor Summary
Constructors Constructor Description QueryInterpreter(SqlRepositoryConfiguration repoConfiguration, ExtItemDictionary extItemDictionary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Matcher<T>
findMatcher(Class<T> type)
<T> Matcher<T>
findMatcher(T value)
RootHibernateQuery
interpret(ObjectQuery query, @NotNull Class<? extends Containerable> type, Collection<SelectorOptions<GetOperationOptions>> options, @NotNull PrismContext prismContext, @NotNull RelationRegistry relationRegistry, boolean countingObjects, @NotNull org.hibernate.Session session)
Condition
interpretFilter(InterpretationContext context, ObjectFilter filter, Restriction parent)
-
-
-
Constructor Detail
-
QueryInterpreter
public QueryInterpreter(SqlRepositoryConfiguration repoConfiguration, ExtItemDictionary extItemDictionary)
-
-
Method Detail
-
interpret
public RootHibernateQuery interpret(ObjectQuery query, @NotNull @NotNull Class<? extends Containerable> type, Collection<SelectorOptions<GetOperationOptions>> options, @NotNull @NotNull PrismContext prismContext, @NotNull @NotNull RelationRegistry relationRegistry, boolean countingObjects, @NotNull @NotNull org.hibernate.Session session) throws QueryException
- Throws:
QueryException
-
interpretFilter
public Condition interpretFilter(InterpretationContext context, ObjectFilter filter, Restriction parent) throws QueryException
- Throws:
QueryException
-
findMatcher
public <T> Matcher<T> findMatcher(T value)
-
-