<div dir="ltr">Hello all,<div><br></div><div>I'm trying to make a simple search query. I want to find all users with an assignment, that don't have XYZ value for organizational unit.</div><div><br></div><div>I can do this just fine:</div><div><div><query></div><div>    <filter></div><div>        <and></div><div>            <ref></div><div>                <path>assignment/targetRef</path></div><div>                <value oid="7d66fc64-1540-44da-8f3d-c565bc917e12"/></div><div>            </ref></div><div>            <equal></div><div>                <path>organizationalUnit</path></div><div>                <value>XYZ</value></div><div>            </equal></div><div>        </and></div><div>    </filter></div><div></query></div></div><div><br></div><div>This will fetch users with the assignment and the value organizationalUnit XYZ</div><div><br></div><div>If I add the <not>...</div><div><div><query></div><div>    <filter></div><div>        <and></div><div>            <ref></div><div>                <path>assignment/targetRef</path></div><div>                <value oid="7d66fc64-1540-44da-8f3d-c565bc917e12"/></div><div>            </ref></div><div>            <not></div><div>              <equal></div><div>                  <path>organizationalUnit</path></div><div>                  <value>NQPPPS</value></div><div>              </equal></div>            </not><div>        </and></div><div>    </filter></div><div></query></div></div><div><br></div><div><br></div><div>This results in a hibernate error:</div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:11px;white-space:pre-wrap">org.hibernate.HibernateException: SqlNode's text did not reference expected number of columns
        at org.hibernate.hql.internal.ast.tree.AbstractNullnessCheckNode.extractMutationTexts(AbstractNullnessCheckNode.java:151)</span><br></div><div>...</div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:11px;white-space:pre-wrap">at com.evolveum.midpoint.repo.sql.query2.hqm.RootHibernateQuery.getAsHqlQuery(RootHibernateQuery.java:96)</span><br></div><div><br></div><div>Am I doing something wrong? Is it a bug? I'm using midpoint 3.6</div><div>Is there any other way to get what I want from a query?<br></div><div><br></div></div>