Hibernate version: 2.1.3 tools 2.1.2
Name and version of the database you are using: Pointbase
I am modeling a four-table composite key relationship: Table1 owned by Table2 owned by Table3 owned by Table4. The primary keys are correctly "inherited" up through Table2, but at the top, Table1, the lengths of two of the PKs are changed from VARCHAR(4) and VARCHAR(5) to VARCHAR(255). I am using hbm2java and hbm2ddl. Is this a bug in hbm2ddl? Thank you - David
So in the example below, KEY2, defined as VARCHAR(4) in Table 4, and KEY3 defined as VARCHAR(5) in Table 3, both become VARCHAR(255) in the youngest "child", Table 1. Note KEY2 and KEY3 have correct lengths in Table 2.
Table 1
<composite-id name="table1PK" class="Table1PK" unsaved-value="none">
<key-many-to-one name="tableX" class="TableX">
<column name="KEY1"/>
</key-many-to-one>
<key-many-to-one name="table2" class="Table2">
<column name="KEY2"/>
<column name="KEY3"/>
<column name="KEY4"/>
</key-many-to-one>
</composite-id>
Table 2
<composite-id name="table2PK" class="Table2PK" unsaved-value="none">
<key-many-to-one name="table3" class="Table3">
<column name="KEY2" />
<column name="KEY3" />
</key-many-to-one>
<key-property name="key4" column="KEY4" type="string" length="3"/>
</composite-id>
Table 3
<composite-id name="table3PK" class="Table3PK" unsaved-value="none">
<key-many-to-one name="table4" class="Table4" column="KEY2"/>
<key-property name="key3" column="KEY3" type="string" length="5"/>
</composite-id>
Table 4
<id name="key2" type="string" column="KEY2" length="4" unsaved-value="none">
<meta attribute="scope-set">protected</meta>
<generator class="assigned"></generator>
</id>
|