-->
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: SchemaExport & Oracle constraints
PostPosted: Fri Mar 11, 2005 3:11 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
All,

Why would SchemaExport create both "not null" AND "primary key" constraints on an ID column? It results in two constraints being created in the database when only the PK is necessary (since it is implicitly a not null constraint).

I don't think it will cause any problems but this was brought to my attention by our DBA and I had no explanation. I tried both OracleDialect and Oracle9Dialect.

Ideas?



Hibernate version:
2.1.8

Mapping documents:
Code:
<hibernate-mapping>
   <class name="model.Test" table="TEST"
      dynamic-update="false" dynamic-insert="false"
      select-before-update="false" optimistic-lock="version">

      <id name="id" column="ID" type="java.lang.Long">
         <generator class="sequence">
            <param name="sequence">TEST_SEQ</param>
         </generator>
      </id>

   </class>
</hibernate-mapping>


Name and version of the database you are using:
Oracle 8i

The generated SQL (show_sql=true):
Code:
create table TEST (
   ID number(19,0) not null,
   primary key (ID)
);
[/code]


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.