-->
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: Problem with SchemaUpdate
PostPosted: Thu Dec 11, 2003 2:43 am 
Beginner
Beginner

Joined: Thu Sep 25, 2003 10:30 am
Posts: 23
Location: india
I am trying to add one relationship to the bean.
The length of the property is 36 char. But while trying to update the table
it fires the alter table query with column length 255 and the very next query to add the foreign key relationship fails.

Is there any problem with my mapping file or is there a problem with the SchemaUpdate class.
below is the xml file
I am trying to add many-to-one relationship in joined-subclass for customer bean


<hibernate-mapping>
<class name="com.webify.ccpa.db.Policy.BasicPolicyDetails" table="TblMst_BasicPolDetails">
<id name="id" column="BPD_PolicyNumber" type="string" length="12">
<generator class="assigned"/>
</id>
<property name="serTaxPaidPrm" column="BPD_serTaxPaidPrm" type="float" length="12"/>
<property name="othPrmDeduct" column="BPD_othPrmDeduct" type="float" length="12"/>
<property name="coInsurerOption" column="BPD_coInsureOption" type="string" length="1"/>
<property name="commCalculated" column="BPD_commCalculated" type="character" length="1"/>
<property name="createBy" column="BPD_CreateBy" length="50"/>
<property name="deleteFlag" column="BPD_DeleteFlag" length="1"/>
<property name="modifiedBy" column="BPD_ModifiedBy" length="50"/>
<property name="modifiedDate" column="BPD_ModifiedDate"/>
<property name="nameOfMO" column="BPD_nameOfMO" length="50"/>
<property name="policyBookingDate" column="BPD_policyBookDate" type="date"/>
<property name="policyEndDate" column="BPD_policyEndDate" type="date"/>
<property name="policyStartDate" column="BPD_policyStartDate" type="date"/>
<property name="premium" column="BPD_Premium" type="float" length="126"/>
<property name="advancePolicyDetailFlag" column="BPD_advPolicyFlag" type="character" length="1"/>
<property name="createDate" column="BPD_CreateDate"/>
<many-to-one name="product" class="com.webify.ccpa.db.Masters.Product" column="PRD_ProductCode"/>
<many-to-one name="location" class="com.webify.ccpa.db.Masters.Location" column="LOC_LocationCode"/>
<many-to-one name="agent" class="com.webify.ccpa.db.Masters.Agent" column="AGT_AgentCode"/>
<many-to-one name="agentType" class="com.webify.ccpa.db.Masters.AgentType" column="ATY_AgentTypeId"/>
<many-to-one name="channel" class="com.webify.ccpa.db.Masters.Channel" column="channelid" />
<many-to-one name="planDefinition" class="com.webify.ccpa.db.Plan.PlanDefinition" cascade="all" column="PND_PlanId"/>

<joined-subclass name="com.webify.ccpa.db.Policy.AdvancePolicyDetails" table="TblMst_AdvancePolDetails">
<key column="BPD_PolicyNumber"/>
<property name="ancillaryDetailsFlag" column="ADP_ancillaryDetailFlag" length="18"/>
<property name="discountInLieu" column="ADP_DiscountInLieu"/>
<property name="premiumPercentage" column="ADP_PremiumPercent"/>
<property name="suminsured" column="ADP_SumInsured"/>
<many-to-one name="customer" class="com.webify.ccpa.db.Masters.Customer" column="CUS_Code"/>
<many-to-one name="productSubType" class="com.webify.ccpa.db.Masters.ProductSubType" column="PST_ProductSubTypeId"/>
<bag name="ancillaryPolicyDetail" cascade="all" inverse="true" lazy="true">
<key column="BPD_PolicyNumber"/>
<one-to-many class="com.webify.ccpa.db.Policy.AncillaryPolicyDetail" />
</bag>

</joined-subclass>

</class>

</hibernate-mapping>


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.