-->
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.  [ 4 posts ] 
Author Message
 Post subject: DB2 OS390 - ddl generation with schemaexport: UNIQUE keyword
PostPosted: Tue Jun 15, 2004 11:24 am 
Newbie

Joined: Tue Jun 15, 2004 8:39 am
Posts: 4
Version hibernate 2.1.4

Problem:

The use of a primary key with DB2 (os390 or z / os) require
to create an index on the primary key. The shape exact is the following one:
CREATE UNIQUE(ONLY) INDEX <nameIndex>

The UNIQUE keyword is mandatory.

Mapping:

I use following mapping:

<hibernate-mapping schema="QXBAPXX">
<class name="Flight" table="COMOR_FLIGHT">
<id name="id" type="integer" unsaved-value="-1">
<column name="id" unique="true" index="ixid"/>
<generator class="native"/>
</id>
....

I use the element column to introduce 'index' and the 'unique' keyword.
In the generation, I obtain the following ddl:

create table QXBAPXX.COMOR_FLIGHT (
id INTEGER not null generated by default as identity unique,
..);

and

create index ixid on QXBAPXX.COMOR_FLIGHT (id);

The good syntax should be:

CREATE UNIQUE INDEX ixid on QXBAPXX.COMOR_FLIGHT (id);


The UNIQUE keyword is missing


Thanks.

_________________
Gilles


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 15, 2004 11:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I'd suggest you add a patch for it against DB2390Dialect to JIRA - should be trivial


Top
 Profile  
 
 Post subject: Post JIRA
PostPosted: Wed Jun 16, 2004 5:45 am 
Newbie

Joined: Tue Jun 15, 2004 8:39 am
Posts: 4
Effectively, the modification is very simple. Posted, JIRA issue #HB-1028.

http://opensource.atlassian.com/projects/hibernate/browse/HB-1028

thanks

_________________
Gilles


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 9:04 am 
Newbie

Joined: Tue Jun 15, 2004 8:39 am
Posts: 4
It is not simple. It is about a new function because you should not modify the creation of index for the not key attributes. The modification that I proposed modifies all index generation. It is not good !!

_________________
Gilles


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

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.