-->
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 changing key lengths in last child?
PostPosted: Tue Oct 19, 2004 11:41 pm 
Newbie

Joined: Wed Jun 02, 2004 7:06 pm
Posts: 8
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>


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.