-->
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.  [ 7 posts ] 
Author Message
 Post subject: Why doesn't this work in 2.1.3!?
PostPosted: Thu May 27, 2004 5:56 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
I was using Hibernate 2.1.2.
I want to upgrade to 2.1.3. When I did so I got "InvalidColumnException: pi" on the following query string:

Code:
private static final String queryFindAllProcessInstances =
"select distinct pi " +
"from org.jbpm.workflow.execution.impl.ProcessInstanceImpl pi," +
"        org.jbpm.workflow.execution.impl.FlowImpl f " +
"where f.processInstance = pi "; 


NOTE:
With 2.1.2 it works fine.

By the 2.1.3 changelog I didn't see nothing regarding this topic.

Any help please?


-------------------------------------------
Mapping files (JBPM Workflow files)
-------------------------------------------
ProcessInstanceImpl
Code:
<?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.workflow.execution.impl.ProcessInstanceImpl"
        table="JBPM_PROCESSINSTANCE"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="id"
            type="long"
            unsaved-value="null"
        >
            <generator class="org.jbpm.util.db.IdGenerator">
            </generator>
        </id>

        <property
            name="start"
            type="timestamp"
            update="true"
            insert="true"
            column="start_"
        />

        <property
            name="end"
            type="timestamp"
            update="true"
            insert="true"
            column="end_"
        />

        <property
            name="initiatorActorId"
            type="string"
            update="true"
            insert="true"
            column="initiatorActorId"
        />

        <many-to-one
            name="processDefinition"
            class="org.jbpm.workflow.definition.impl.ProcessDefinitionImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="processDefinition"
        />

        <many-to-one
            name="rootFlow"
            class="org.jbpm.workflow.execution.impl.FlowImpl"
            cascade="all"
            outer-join="auto"
            update="true"
            insert="true"
            column="rootFlow"
        />

        <many-to-one
            name="superProcessFlow"
            class="org.jbpm.workflow.execution.impl.FlowImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="superProcessFlow"
        />

    </class>

</hibernate-mapping>


FlowImpl
Code:
<?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.workflow.execution.impl.FlowImpl"
        table="JBPM_FLOW"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="id"
            type="long"
            unsaved-value="null"
        >
            <generator class="org.jbpm.util.db.IdGenerator">
            </generator>
        </id>

        <property
            name="name"
            type="string"
            update="true"
            insert="true"
            column="name"
        />

        <property
            name="actorId"
            type="string"
            update="true"
            insert="true"
            column="actorId"
        />

        <property
            name="start"
            type="timestamp"
            update="true"
            insert="true"
            column="start_"
        />

        <property
            name="end"
            type="timestamp"
            update="true"
            insert="true"
            column="end_"
        />

        <property
            name="parentReactivation"
            type="boolean"
            update="true"
            insert="true"
            column="parentReactivation"
        />

        <many-to-one
            name="node"
            class="org.jbpm.workflow.definition.impl.NodeImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="node"
        />

        <many-to-one
            name="processInstance"
            class="org.jbpm.workflow.execution.impl.ProcessInstanceImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="processInstance"
        />

        <set
            name="attributeInstances"
            lazy="true"
            inverse="false"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="scope"
              />

              <one-to-many
                  class="org.jbpm.workflow.execution.impl.AttributeInstanceImpl"
              />
        </set>

        <set
            name="subProcessInstances"
            lazy="true"
            inverse="false"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="superProcessFlow"
              />

              <one-to-many
                  class="org.jbpm.workflow.execution.impl.ProcessInstanceImpl"
              />
        </set>

        <many-to-one
            name="parent"
            class="org.jbpm.workflow.execution.impl.FlowImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="parent"
        />

        <set
            name="children"
            lazy="true"
            inverse="false"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="parent"
              />

              <one-to-many
                  class="org.jbpm.workflow.execution.impl.FlowImpl"
              />
        </set>

        <set
            name="logs"
            lazy="true"
            inverse="false"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="flow"
              />

              <one-to-many
                  class="org.jbpm.workflow.log.impl.LogImpl"
              />
        </set>

    </class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 6:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Most likley "pi" is a keyword in your database. Change the alias in your query.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 6:40 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
michael wrote:
Most likley "pi" is a keyword in your database. Change the alias in your query.



Thanks for the reply.
I didn't change my database version.
This is working with Hibernate 2.1.2. I only updated the Hibernate libs to 2.1.3 and it doesn't work.
So I think changing the alias wont help.


Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 6:45 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
It will help.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 7:17 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
christian wrote:
It will help.



Your right!
I changed it to something else and it worked!

Please tell me... in 2.1.3 did "pi" appear as a reserved word?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 7:17 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No, but the alias/function name precedence changed, unfortunately.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 27, 2004 7:20 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
christian wrote:
No, but the alias/function name precedence changed, unfortunately.



Thanks very much for the info.


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

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.