1 Reply Latest reply on Feb 24, 2007 6:59 AM by Ronald van Kuijk

    Hibernate Query To SQL Query Mismatch

    Anandha Newbie

      I am trying to convert the following SQL to equivalent Hibernate Query.

      SELECT ti.id_, ti.name_, t.processinstance_, pi.processdefinition_
      FROM jbpm_taskinstance ti, jbpm_token t, jbpm_processinstance pi
      WHERE ti.token_ = t.id_
      AND t.processinstance_ = pi.id_
      AND pi.processdefinition_ = 1474
      AND ti.name_ = 'Initiate Swap'
      AND ti.isopen_ = 0
      This query is given 1 record from the DB

      But when I am trying the equivalent Hibernate query it is not giving any results. (No one has deleted the data in the meantime, though ;-)

      SELECT ti
      FROM org.jbpm.taskmgmt.exe.TaskInstance ti join ti.token tok join tok.processInstance pi
      WHERE
      pi.processDefinition = (:processDefinitionId)
      AND ti.name = (:name)
      AND ti.isOpen = (:state)
      I have set the same values for the parameters.


      By any choice am I missing any basic elements?