Hi everybody,
I have defined ( I am using Oracle 10 and jdk 1.4 ) a sequence which correctly generates my ID field.
I need to populate another two fields of the table with the same values which are generated by the sequence.
For example, my id field is TASKID , and I have TASKNUMBER and INSTANCEID which should have the
same values of TASKID.
I have mapped my bean PcTask.java as follows :
Code:
<hibernate-mapping package="previtc.model.task">
<class name="PcTask" table="PC_TASK" dynamic-update="true" dynamic-insert="true">
<id name="taskId" column="TASKID" type="string">
<generator class="sequence">
<param name="sequence">PC_TASK_ID_SEQ</param>
</generator>
</id>
<property name="taskNumber" column="TASKNUMBER" type="double" />
<property name="acquiredBy" column="ACQUIREDBY" type="string" />
<property name="approvers" column="APPROVERS" type="string" />
<property name="comment1" column="COMMENT1" type="string" />
<property name="comment2" column="COMMENT2" type="string" />
<property name="comment3" column="COMMENT3" type="string" />
<property name="comment4" column="COMMENT4" type="string" />
<property name="comment5" column="COMMENT5" type="string" />
<property name="conclusion" column="CONCLUSION" type="string" />
<property name="createdDate" column="CREATEDDATE" type="date" />
<property name="creator" column="CREATOR" type="string" />
<property name="domainId" column="DOMAINID" type="string" />
<property name="expirationDate" column="EXPIRATIONDATE" type="date" />
<property name="expirationDuration" column="EXPIRATIONDURATION" type="string" />
<property name="flexDate1" column="FLEXDATE1" type="date" />
<property name="flexDate2" column="FLEXDATE2" type="date" />
<property name="flexDate3" column="FLEXDATE3" type="date" />
<property name="flexDouble1" column="FLEXDOUBLE1" type="double" />
<property name="flexDouble2" column="FLEXDOUBLE2" type="double" />
<property name="flexLong1" column="FLEXLONG1" type="double" />
<property name="flexLong2" column="FLEXLONG2" type="double" />
<property name="flexString1" column="FLEXSTRING1" type="string" />
<property name="flexString2" column="FLEXSTRING2" type="string" />
<property name="flexString3" column="FLEXSTRING3" type="string" />
<property name="flexString4" column="FLEXSTRING4" type="string" />
<property name="identificationKey" column="IDENTIFICATIONKEY" type="string" />
<property name="instanceId" column="INSTANCEID" type="string" />
<property name="isGroup" column="ISGROUP" type="string" />
<property name="isHassubTask" column="ISHASSUBTASK" type="string" />
<property name="modifyDate" column="MODIFYDATE" type="date" />
<property name="notm" column="NOTM" type="integer"/>
<property name="owner" column="OWNER" type="string" />
<property name="pattern" column="PATTERN" type="string" />
<property name="priority" column="PRIORITY" type="integer"/>
<property name="processId" column="PROCESSID" type="string" />
<property name="processName" column="PROCESSNAME" type="string" />
<property name="processOwner" column="PROCESSOWNER" type="string" />
<property name="processVersion" column="PROCESSVERSION" type="string" />
<property name="state" column="STATE" type="string" />
<property name="substate" column="SUBSTATE" type="string" />
<property name="systemString1" column="SYSTEMSTRING1" type="string" />
<property name="systemString2" column="SYSTEMSTRING2" type="string" />
<property name="systemString3" column="SYSTEMSTRING3" type="string" />
<property name="taskGroupId" column="TASKGROUPID" type="string" />
<property name="taskType" column="TASKTYPE" type="string" />
<property name="title" column="TITLE" type="string" />
<property name="updatedBy" column="UPDATEDBY" type="string" />
<property name="version" column="VERSION" type="integer" />
<property name="versionReason" column="VERSIONREASON" type="string" />
</class>
</hibernate-mapping>
Please, could anybody give me some hint to do that ? Thanks a lot! Any help will be appreciated !