Hello Everyone,
I have the below mapping in my .hbm file.
<hibernate-mapping> <class name="Activity" table="ACTIVITY_TABLE" lazy="true" discriminator-value="A"> <id name="activityNo" type="long"> <column name="ACTIVITY_NO" precision="8" scale="0" /> <generator class="sequence"> <param name ="sequence">SEQ_ACTIVITY_TABLE</param> </generator> </id> </hibernate-mapping>
In my code I will populate the activity object and after calling the flush() method, data is stored in the table with the generated activity number. I have created a new column called ACTIVITY_ORDER in the table. The requirement is after calling the flush method, I need to assign the generated ACTIVITY_NO value to ACITIVY_ORDER.
I tried assigning the value with the below mapping but doesn't work.
<property name="activityOrder" type="long" formula="nvl(ACTIVITY_ORDER,ACTIVITY_NO)"> <column name="ACTIVITY_ORDER" precision="8" scale="0" /> </property>
Thanks, Yaragalla
|