Hi,

I have a class ProcessInstanceImpl that has a member workingUsers declared
as an Hashtable of WorkingUser objects.

here are the extracts of source file and mapping file :

//// SOURCE ////
public class ProcessInstanceImpl
{
        /**
         * the instance Id 
         * @field-name instanceId
         * @sql-type integer
         * @primary-key
         */
        private String instanceId = null;

        /**
         * Hashtable of all users who can act on this process instance
         * @field-name workingUsers
         * @field-type com.silverpeas.workflow.engine.instance.WorkingUser
         * @many-key instanceId
         * @set-method  setWorkingUsers
         * @get-method  getWorkingUsers
         */
        private Hashtable workingUsers = null;

        /**
         * Set users who can act on this process instance
         * @param       workingUsers    users as a Hashtable
         * @return
         */
        public void setWorkingUsers(Hashtable workingUsers)
        {
                this.workingUsers = workingUsers;
        }

        /**
         * Get users who can act on this process instance
         * @return      users as a Hashtable
         */
        public Hashtable getWorkingUsers()
        {
                return workingUsers;
        }
}

//// MAPPING ////
  <class name="com.silverpeas.workflow.engine.instance.ProcessInstanceImpl"
key-generator="MAX" identity="instanceId">
    <map-to table="SB_Workflow_ProcessInstance" />
    <field name="instanceId" type="string">
      <sql type="integer" name="instanceId" />
      <bind-xml name="instanceId" />
    </field>
    <field name="workingUsers" collection="hashtable"
type="com.silverpeas.workflow.engine.instance.WorkingUser"
set-method="castor_setWorkingUsers" get-method="castor_getWorkingUsers">
      <sql many-key="instanceId" />
      <bind-xml name="workingUsers" />
    </field>
  </class>

  <class name="com.silverpeas.workflow.engine.instance.WorkingUser"
depends="com.silverpeas.workflow.engine.instance.ProcessInstanceImpl"
identity="userId processInstance">
    <map-to table="SB_Workflow_WorkingUser" />
    <field name="userId" type="string">
      <sql name="userId" />
      <bind-xml name="userId" />
    </field>
    <field name="processInstance"
type="com.silverpeas.workflow.engine.instance.ProcessInstanceImpl">
      <sql name="instanceId" />
      <bind-xml name="processInstance" />
    </field>
  </class>

PROBLEM :
When I get the processInstance from database, I get the following error :

Exception in thread "main" org.exolab.castor.jdo.DataObjectAccessException:
Type
 conversion error: could not set value of FieldMolder of
com.silverpeas.workflow
.engine.instance.WorkingUser.setprocessInstance(com.silverpeas.workflow.engi
ne.i
nstance.ProcessInstanceImpl processInstance) with value of type
java.lang.String

Did I make something wrong in source file or mapping file ??

Thanks 
Ludovic

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to