<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
                 version="1.0">
  <named-query name="ProcessInstancesWaitingForEvent">
    <query>
      select
      processInstanceInfo.processInstanceId
      from
      ProcessInstanceInfo processInstanceInfo
      where
      :type in elements(processInstanceInfo.eventTypes)
    </query>
  </named-query>
  <named-query name="GetProcessInstanceIdByCorrelation">
    <query>
      select
      key.processInstanceId
      from
      CorrelationKeyInfo key
      where
      key.name = :ckey
    </query>
  </named-query>
  <named-query name="GetCorrelationKeysByProcessInstanceId">
    <query>
      select
      key
      from
      CorrelationKeyInfo key
      where
      key.processInstanceId = :pId
    </query>
  </named-query>
</entity-mappings>
