-->
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: Case-sensitivity causes exportddl to duplicate columns
PostPosted: Tue Apr 26, 2005 8:17 am 
Newbie

Joined: Tue Apr 12, 2005 10:37 am
Posts: 6
Hibernate version:
3.0.1

Mapping documents:
<class name="Child"
table="CHILD">
<composite-id name="key"
class="ChildPK">
<key-property name="key1" column="KEY1"
type="java.lang.Long" length="19">
</key-property>
<key-property name="key2" column="KEY2"
type="java.lang.Long" length="19">
</key-property>
</composite-id>
<!-- bi-directional many-to-one association to Parent -->
<many-to-one
name="parent"
class="Parent"
not-null="true"
column="parent_id"
/>
</class>
<class name="Parent"
table="PARENT">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="name" type="java.lang.String"
column="NAME" length="250">
</property>
<!-- bi-directional one-to-many association to Childl -->
<list name="children">
<key column="parent_id"/>
<list-index column="key2" base="1"/>
<one-to-many class="Child"/>
</list>
</class>

DDL generated by exportddl
create table PARENT (
id bigint generated by default as identity (start with 1),
NAME varchar(250),
primary key (id)
);
create table CHILD (
KEY1 bigint not null,
KEY2 bigint not null,
parent_id bigint not null,
key2 integer,
primary key (KEY1, KEY2)
);

Note
See that exportddl has generated two "key2" columns in the child table, one from the composite-id (KEY2), and one from the list-index in the Parent mapping (key2).

When I change the case of the list-index column, the "duplicate" column goes away.

Is this a bug or a feature (maybe for case-sensitive databases?).

John Latham


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.