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