0 Replies Latest reply on Sep 4, 2007 3:56 AM by null null

    An HQL question ...

    null null Newbie

      Hi all,

      I use JBoss 4.2.0 + jBPM 3.2.1 + Hibernate 3 with a PostgreSQL 8.2.4 database.
      I'd like to perform an HQL query which could generate the following SQL query :

      select name_, version_
      from jbpm_processdefinition d1
      where not exists (select name_, version_
      from jbpm_processdefinition d2
      where d2.name_ = d1.name_
      and d2.version_ = d1.version_ +1)

      Is there a way to do that ?

      select d1.name, d1.version
      from ProcessDefinition d1
      where not exist (select d2.name, d2.version
      from ProcessDefinition d2
      where d2.name = d1.name
      and d2.version = d1.version+1)
      doesn't work.

      Regards
      A. ROY