[hibernate-issues] [Hibernate-JIRA] Created: (HBX-978) unique=true attribute of primary key in generated class prevents the schema to be regenerated

Ali Sadik Kumlali (JIRA) noreply at atlassian.com
Mon Aug 20 12:06:13 EDT 2007


unique=true attribute of primary key in generated class prevents the schema to be regenerated
---------------------------------------------------------------------------------------------

                 Key: HBX-978
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-978
             Project: Hibernate Tools
          Issue Type: Bug
         Environment: OS: Windows Vista 6.0,x86
Database: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Java VM: Java HotSpot(TM) Server VM 1.5.0_11-b03,Sun Microsystems Inc.
Eclipse Europa: Version: 3.3.0 Build id: I20070621-1340
HibernateTools-3.2.0.beta10
            Reporter: Ali Sadik Kumlali
            Priority: Minor


Hi,

When I reverse engineer against Oracle, unique=true attribute is added to @Column annotation of primary key column. But, when I generate schema from these generated files, Oracle throws "ORA-02261: such unique or primary key already exists in the table" error.

I first ran into this situation while trying Seam and posted the problem to Seam's forum:  http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116478. After I got the response, decided to try it without Seam. Then, downloaded the latest HibernateTools & Eclipse Europa and reverse engineered the schema. I saw that generated classes have unique=true attribute which clearly showed that the problem was related with HibernateTools, not with Seam.

Here is the DDL of the table against which I made my test:

CREATE TABLE PEOPLE ("ID" NUMBER NOT NULL, "SURNAME" VARCHAR2(50 BYTE), "NAME" VARCHAR2(25 BYTE), CONSTRAINT "PEOPLE_PK" PRIMARY KEY ("ID"));

Regards,

Ali Sadik Kumlali

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list