-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: SQL to HQL
PostPosted: Sat Feb 19, 2005 5:05 am 
Newbie

Joined: Fri Feb 18, 2005 9:23 am
Posts: 10
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.