hbm2ddl generate additional foreign key column for super class when try to map from holder
class to sub class
-------------------------------------------------------------------------------------------------------------
Key: HHH-2117
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2117
Project: Hibernate3
Type: Bug
Versions: 3.1.3
Environment: MS SQL 2000, PointBase Micro 5
Reporter: Egor
Priority: Minor
I have next classes
SuperClass
|
| * 1
SubClasss-----HolderClass
Mappings for this classes
<class name="SuperClass" table="locations"
discriminator-value="0">
<id name="idSuperClass" type="short">
<column name="id_super_class" />
<generator class="assigned" />
</id>
<discriminator type="byte">
<column name="class_type" />
</discriminator>
......................................
</class>
<subclass name="SubClass" extends="SuperClass"
discriminator-value="1">
<join table="SubClass">
<key>
<column name="id_super_class" />
</key>
<many-to-one name="holderClass" class="HolderClass" >
<column name="id_holder_class" />
</many-to-one>
......................................
</join>
</subclass>
<class name="HolderClass" table="HolderClass">
<id name="idHolderClass" type="short">
<column name="id_holder_class" />
<generator class="assigned" />
</id>
<bag name="subClassList" table="SubClass"
inverse="true">
<key column="id_holder_class" />
<one-to-many class="SubClass" />
</bag>
......................................
</class>
When I try to generate schema with SchemaExport, i get next tables
FK
SuperClass-----
|PK |
|FK PK|
SubClasss-----HolderClass
FK
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira