Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-2789

CLONE -Annotations - Oracle/Sybase - Unique/Primary Key declared twice raises an error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: EAP 5.0.0.CR3, EAP 5.0.0.CR4 (FCS and BETA2), EAP 5.0.0.CR5, EAP 5.0.0
    • Fix Version/s: None
    • Component/s: Hibernate
    • Labels:
      None
    • Environment:

      oracle, sybase

    • Affects:
      Release Notes
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      remove @Column( unique = true ) annotation from the property that declared as "unique" or "primary key"

      Show
      remove @Column( unique = true ) annotation from the property that declared as "unique" or "primary key"

      Description

      In Oracle, if a property is declared as "unique" or "primary key" and the unique/primary key keyword is used to define the same property defined as unique/primary key, it raises the error:
      ORA-02261: such unique or primary key already exists in the table

      Example of a failing sql statement:
      create table Frame (id number(19,0) not null, name varchar2(255 char) unique, primary key (id), unique (name))

      Tests affected by this:
      org.hibernate.test.annotations.manytomany.ManyToManyTest
      org.hibernate.test.annotations.manytoone.ManyToOneTest

      Models affected by this:
      org.hibernate.test.annotations.manytomany.BuildingCompany
      org.hibernate.test.annotations.manytomany.Group
      org.hibernate.test.annotations.manytoone.Frame

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                stliu Strong Liu
                Reporter:
                juraci.costa Juraci Paixão Kröhling
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: