-->
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: Multiple sequence definition OR composite id sequence
PostPosted: Mon Apr 18, 2011 10:11 am 
Beginner
Beginner

Joined: Mon Apr 18, 2011 10:01 am
Posts: 20
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 !


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.