-->
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: hbm2ddl generates foreign key constrains for any type mapp
PostPosted: Wed Nov 30, 2005 4:52 am 
Newbie

Joined: Wed Nov 30, 2005 4:34 am
Posts: 2
while i use the "Table per concrete class, using implicit polymorphism" in hibernate 3.05, the following is my mapping file:


<list>


Code:


<class
        name="com.css.hr.RelationShip"
        table="RELATIONSHIP"
        proxy="com.css.hr.RelationShip"
        mutable="true"
    >

<any
                  name="from"
                  id-type="long"
                  meta-type="string"
                  cascade="none"
                  access="property"
              >
                <meta-value
                    value="PERSONROLE"
                    class = "com.css.hr.PersonRole"
                />
                <meta-value
                    value="ORGANIZATIONROLE"
                    class = "com.css.hr.OrganizationRole"
                />
                <column
                    name="FROMPARTYROLE_CLASS"
                />
                <column
                    name="FROMPARTYROLE_ID"
                />
   
              </any>





</list>

The personRole and OrgnaizationRole are the subclass of PartRole, and i use the "Table per concrete class, using implicit polymorphism" strategy!

the Question is " while i using the hbm2dll, it product the two foreign keys constrains for the column "FROMPARTYROLE"-- one reference to table
"PERSONROLE" and one for table "ORGANIZATIONROLE" ". The result is it would cause db exception while i save a object of RelationShip .


Is it a bug or what's wrong with the mapping file?
thx!


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.