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

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Thu Feb 5 07:35:38 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32322#action_32322 ] 

Max Rydahl Andersen commented on HBX-978:
-----------------------------------------

I guess we should not mark a column unique when reverse engineering and that column is also the primary key....

> 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
>         Attachments: hbx-978.patch
>
>
> 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