| I have a pretty straight forward one-to-many relationship modeled, and I keep receiving the following error:
 CMSProcessor::processAddition--Update Failed net.sf.hibernate.HibernateException: identifier of an instance of forecastingModel.Tunnel altered from 21 to 21
 
 (where 19 is the generated sequence number).
 
 
 In this scenario, I'm simply creating one new parent and one new child object, adding the child to the parents collection, and then calling session.save(parent).
 
 
 Here's the segment from my log file, and the mappings for parent and child are below that.
 
 Thanks for any help,
 Brandon
 
 
 16:33:21,304 DEBUG BatcherImpl:166 - about to open: 0 open PreparedStatements, 0 open ResultSets
 16:33:21,304 DEBUG SessionFactoryImpl:526 - prepared statement get: select hibernate_sequence.nextval from dual
 16:33:21,366 DEBUG SequenceGenerator:70 - Sequence identifier generated: 21
 16:33:21,366 DEBUG BatcherImpl:173 - done closing: 0 open PreparedStatements, 0 open ResultSets
 16:33:21,382 DEBUG SessionImpl:656 - saving [forecastingModel.Tunnel#21]
 16:33:21,398 DEBUG SessionImpl:2520 - Wrapped collection in role: forecastingModel.Tunnel.genericUsages
 CMSProcessor::processAddition--save usage
 [10/10/03 16:33:21:413 EDT] 4c98f36c SystemOut     O CMSProcessor::processAddition--save tunnel  21
 [10/10/03 16:33:21:413 EDT] 4c98f36c SystemOut     O 16:33:21,413 DEBUG JDBCTransaction:54 - commit
 16:33:21,413 DEBUG SessionImpl:2011 - flushing session
 16:33:21,429 DEBUG SessionImpl:2113 - Flushing entities and processing referenced collections
 16:33:21,429 DEBUG SessionImpl:447 - transaction completion
 CMSProcessor::processAddition--Update Failed net.sf.hibernate.HibernateException: identifier of an instance of forecastingModel.Tunnel altered from 21 to 21
 [10/10/03 16:33:21:429 EDT] 4c98f36c SystemOut     O 16:33:21,429 DEBUG JDBCTransaction:77 - rollback
 16:33:21,444 DEBUG SessionImpl:447 - transaction completion
 16:33:21,444 DEBUG SessionImpl:435 - closing session
 16:33:21,444 DEBUG SessionImpl:2930 - disconnecting session
 16:33:21,444 DEBUG DriverManagerConnectionProvider:117 - returning connection to pool, pool size: 1
 16:33:21,444 DEBUG SessionImpl:447 - transaction completion
 
 
 
 <hibernate-mapping>
 <class name="forecastingModel.Tunnel" table="tunnel">
 <id
 name="tunnelID"
 column="tunnel_ID" type="integer">
 <generator class="native"/>
 </id>
 
 
 <property name="materialNumber" column="material_number" type="string" length="25"/>
 <property name="forecastKey" column="forecast_key" type="string" length="50"/>
 <property name="marketType" column="market_type" type="string" length="10"/>
 <property name="distributionChannel" column="distribution_channel" type="string" length="10"/>
 <property name="clubCode" column="club_code" type="string" length="4"/>
 <property name="componentType" column="component_type" type="string" length="10"/>
 <property name="usageType" column="usage_type" type="string" length="10"/>
 <property name="contentCode" column="content_code" type="string" length="10"/>
 <property name="lastMailDate" column="last_mail_date" type="date"/>
 <many-to-one name="theAttritionCurve"/>
 <many-to-one name="theAutoshipmentCurve"/>
 <many-to-one name="theAutoshipmentReturnCurve"/>
 <many-to-one name="theAutoReturnInfo"/>
 <many-to-one name="theCutoverIndicator"/>
 <many-to-one name="thePriceChangeFactor"/>
 <many-to-one name="theResponseCurve"/>
 <many-to-one name="theSizeChangeFactor"/>
 <many-to-one name="theNewMemberGroupingGrid"/>
 
 
 <list
 name="genericUsages"
 lazy="true"
 inverse="true">
 <key column="theTunnel"/>
 <index column="sequence_number"/>
 <one-to-many class="forecastingModel.GenericUsage"/>
 </list>
 
 
 </class>
 
 </hibernate-mapping>
 
 
 /*child mapping*/
 <hibernate-mapping>
 <class name="forecastingModel.GenericUsage" table="generic_usage" discriminator-value="G">
 
 <id name="usageId" column="usage_ID" length="10" type="string">
 <generator class="assigned"/>
 </id>
 <discriminator column="usagetype" type="character"/>
 <property name="actualPullRate" column="actual_pull_rate" type="long"/>
 <property name="attritionRate" column="attrition_rate" type="long"/>
 <property name="cmsPullRate" column="cms_pull_rate" type="long"/>
 <property name="componentProductId" column="component_prod_id" type="string" length="10"/>
 <property name="cutoverDate" column="cutover_date" type="date"/>
 <property name="forecastedDemand" column="forecasted_demand" type="integer"/>
 <property name="forecastingPullRate" column="forecasting_pull_rate" type="long"/>
 <property name="labelRunDate" column="label_run_date" type="date"/>
 <property name="mailDate" column="mail_date" type="date"/>
 <property name="materialNumber" column="material_number" type="string" length="10"/>
 <property name="membersAddressed" column="members_addressed" type="integer" length="10"/>
 <property name="overridePullRate" column="override_pull_rate" type="long"/>
 <property name="pageSize" column="page_size" type="long"/>
 <property name="pageSizeChangeFactor" column="pagesize_change_factor" type="long"/>
 <property name="partialMatchSourceID"  column="partial_match_source_id" type="string" length="10"/>
 <property name="price" type="long"/>
 <property name="priceChangeFactor" column="price_change_factor" type="long"/>
 
 <property name="salesToDate" column="sales_to_date" type="integer"/>
 <property name="sequenceNumber" column="sequence_number" type="integer"/>
 <property name="channel" type="string" length="10"/>
 <property name="clubPrice" column="club_price" type="long"/>
 <property name="componentId" column="component_id" type="string" length="10"/>
 <property name="componentType" column="component_type" type="string" length="10"/>
 <property name="contentCode" column="content_code" type="string" length="10"/>
 <property name="countAs" column="count_as" type="integer"/>
 <property name="marketType" column="market_type" type="string" length="10"/>
 <property name="negativePullRate" column="negative_pull_rate" type="long"/>
 <property name="packageId" column="package_id" type="string" length="10"/>
 <property name="percentOfPage" column="percent_of_page" type="long"/>
 <property name="promoPeriodId" column="promo_period_id" type="string" length="4"/>
 <property name="promoScheduleId" column="promo_schedule_id" type="string" length="4"/>
 <property name="pullRate" column="pull_rate" type="long"/>
 <property name="usageType" column="usage_type" type="string" length="10"/>
 <property name="clubCode" column="club_code" type="string" length="4"/>
 
 
 
 
 
 <subclass name="forecastingModel.CurrentMemberUsage" discriminator-value="C">
 <property name="refusalToDate" column="refusal_to_date" type="integer"/>
 <many-to-one name="theAutoshipment" class="forecastingModel.Autoshipment"/>
 </subclass>
 
 <subclass name="forecastingModel.NewMemberUsage" discriminator-value="N">
 <property name="enrollToDate" column="enroll_to_date" type="integer"/>
 </subclass>
 </class>
 
 </hibernate-mapping>
 
 
 |