can someone help to convert this query to Hql
select involog.id,exelog.id,exelog..state from org.jbpm.model.log.impl.InvocationLogImpl involog, org.jbpm.model.log.impl.ExecutionLogImpl exelog where exelog.invocationLog=involog.id and involog.serviceMethod='endOfState' and involog.actorId="testuser"
mappings are as below :
these files are from jbpm :
jbpm_exelog :
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.jbpm.model.log.impl.ExecutionLogImpl" table="JBPM_EXELOG" discriminator-value="ExeLog">
<id name="id" type="long" unsaved-value="null">
<generator class="org.jbpm.persistence.hibernate.ConfigurableIdGenerator" />
</id>
<discriminator />
<many-to-one name="invocationLog" class="org.jbpm.model.log.impl.InvocationLogImpl" cascade="none" />
<property name="index" type="integer" column="index_" />
<subclass name="org.jbpm.model.log.impl.VariableCreationLogImpl" discriminator-value="VarCreate">
<many-to-one name="variableInstance" class="org.jbpm.model.execution.impl.VariableInstanceImpl" cascade="none" column="varinst1" />
</subclass>
<subclass name="org.jbpm.model.log.impl.VariableUpdateLogImpl" discriminator-value="VarUpdate">
<property name="oldValueText" type="string" column="text1" />
<property name="newValueText" type="string" column="text2" />
<many-to-one name="variableInstance" class="org.jbpm.model.execution.impl.VariableInstanceImpl" cascade="none" column="varinst2" />
</subclass>
<subclass name="org.jbpm.model.log.impl.ActionLogImpl" discriminator-value="Action">
<many-to-one name="action" class="org.jbpm.model.definition.impl.ActionImpl" cascade="none" column="action_" />
</subclass>
<subclass name="org.jbpm.model.log.impl.StateLogImpl" discriminator-value="State">
<many-to-one name="previous" class="org.jbpm.model.log.impl.StateLogImpl" cascade="none" />
<property name="actorId" type="string" column="text1" />
<many-to-one name="state" class="org.jbpm.model.definition.impl.StateImpl" cascade="none" />
</subclass>
<subclass name="org.jbpm.model.log.impl.EndOfTokenLogImpl" discriminator-value="EndOfToken">
<many-to-one name="token" class="org.jbpm.model.execution.impl.TokenImpl" cascade="none" />
</subclass>
<subclass name="org.jbpm.model.log.impl.MessageLogImpl" discriminator-value="Msg">
<property name="level" type="org.jbpm.persistence.hibernate.EnumType$LevelType" column="int_one" />
<property name="message" type="string" column="text2" />
</subclass>
<subclass name="org.jbpm.model.log.impl.SubTokenLogImpl" discriminator-value="SubToken">
<many-to-one name="subToken" class="org.jbpm.model.execution.impl.TokenImpl" cascade="none" />
</subclass>
</class>
</hibernate-mapping>
jbpm_invokelog:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.jbpm.model.log.impl.InvocationLogImpl" table="JBPM_INVOKELOG">
<id name="id" type="long" unsaved-value="null">
<generator class="org.jbpm.persistence.hibernate.ConfigurableIdGenerator" />
</id>
<property name="actorId" type="string" />
<many-to-one name="token" class="org.jbpm.model.execution.impl.TokenImpl" cascade="none" />
<property name="date" type="timestamp" column="date_" />
<property name="serviceMethod" type="org.jbpm.persistence.hibernate.EnumType$ServiceMethodType" />
<property name="isUndoable" type="boolean" />
<list name="executionLogs" lazy="true" cascade="all">
<key column="invocationLog" />
<index column="index_" />
<one-to-many class="org.jbpm.model.log.impl.ExecutionLogImpl" />
</list>
</class>
</hibernate-mapping>
|