Search in sources :

Example 16 with RootHibernateQuery

use of com.evolveum.midpoint.repo.sql.query2.hqm.RootHibernateQuery in project midpoint by Evolveum.

the class ItemPathResolver method addTextInfoJoin.

public String addTextInfoJoin(String currentHqlPath) throws QueryException {
    RootHibernateQuery hibernateQuery = context.getHibernateQuery();
    String joinedItemJpaName = RObject.F_TEXT_INFO_ITEMS;
    String joinedItemFullPath = currentHqlPath + "." + joinedItemJpaName;
    String joinedItemAlias = hibernateQuery.createAlias(joinedItemJpaName, false);
    hibernateQuery.getPrimaryEntity().addJoin(new JoinSpecification(joinedItemAlias, joinedItemFullPath, null));
    return joinedItemAlias;
}
Also used : RootHibernateQuery(com.evolveum.midpoint.repo.sql.query2.hqm.RootHibernateQuery) JoinSpecification(com.evolveum.midpoint.repo.sql.query2.hqm.JoinSpecification)

Example 17 with RootHibernateQuery

use of com.evolveum.midpoint.repo.sql.query2.hqm.RootHibernateQuery in project midpoint by Evolveum.

the class QueryEngine2 method interpret.

public RQuery interpret(ObjectQuery query, Class<? extends Containerable> type, Collection<SelectorOptions<GetOperationOptions>> options, boolean countingObjects, Session session) throws QueryException {
    QueryInterpreter2 interpreter = new QueryInterpreter2(repoConfiguration);
    RootHibernateQuery hibernateQuery = interpreter.interpret(query, type, options, prismContext, countingObjects, session);
    return new RQueryImpl(hibernateQuery.getAsHqlQuery(session), hibernateQuery);
}
Also used : RootHibernateQuery(com.evolveum.midpoint.repo.sql.query2.hqm.RootHibernateQuery)

Aggregations

RootHibernateQuery (com.evolveum.midpoint.repo.sql.query2.hqm.RootHibernateQuery)13 QueryException (com.evolveum.midpoint.repo.sql.query.QueryException)7 Condition (com.evolveum.midpoint.repo.sql.query2.hqm.condition.Condition)6 AndCondition (com.evolveum.midpoint.repo.sql.query2.hqm.condition.AndCondition)5 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)4 RPolyString (com.evolveum.midpoint.repo.sql.data.common.embedded.RPolyString)3 QName (javax.xml.namespace.QName)3 QueryInterpreter2 (com.evolveum.midpoint.repo.sql.query2.QueryInterpreter2)2 JoinSpecification (com.evolveum.midpoint.repo.sql.query2.hqm.JoinSpecification)2 OrCondition (com.evolveum.midpoint.repo.sql.query2.hqm.condition.OrCondition)2 HqlDataInstance (com.evolveum.midpoint.repo.sql.query2.resolution.HqlDataInstance)2 RUtil.qnameToString (com.evolveum.midpoint.repo.sql.util.RUtil.qnameToString)2 PrismReferenceValue (com.evolveum.midpoint.prism.PrismReferenceValue)1 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)1 AllFilter (com.evolveum.midpoint.prism.query.AllFilter)1 ComparativeFilter (com.evolveum.midpoint.prism.query.ComparativeFilter)1 EqualFilter (com.evolveum.midpoint.prism.query.EqualFilter)1 ObjectPagingAfterOid (com.evolveum.midpoint.repo.sql.ObjectPagingAfterOid)1 RObject (com.evolveum.midpoint.repo.sql.data.common.RObject)1 RObjectType (com.evolveum.midpoint.repo.sql.data.common.other.RObjectType)1