Bug 991578 - HHH-8390 Foreign key reference generated before unique constraint exists
Summary: HHH-8390 Foreign key reference generated before unique constraint exists
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: EAP 6.2.0
Assignee: Brett Meyer
QA Contact: Zbyněk Roubalík
Russell Dickenson
URL:
Whiteboard:
Depends On:
Blocks: 991581 eap62-upgrade-hibernate425
TreeView+ depends on / blocked
 
Reported: 2013-08-02 18:47 UTC by Ricardo Martinelli de Oliveira
Modified: 2018-12-02 16:37 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 991581 (view as bug list)
Environment:
Last Closed: 2013-12-15 16:13:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ricardo Martinelli de Oliveira 2013-08-02 18:47:12 UTC
In H2 the generated schema works:
[main            ] DEBUG  - 18:27:01,763 - org.hibernate.SQL: 
    create table Item (
        id bigint not null,
        name varchar(255),
        SELLER_CUSTOMERNR varchar(255),
        primary key (id)
    )
[main            ] DEBUG  - 18:27:01,769 - org.hibernate.SQL: 
    create table USERS (
        id bigint not null,
        customerNr varchar(255),
        primary key (id)
    )
[main            ] DEBUG  - 18:27:01,769 - org.hibernate.SQL: 
    alter table Item 
        add constraint FK_76d41162ea614944b8333c7c440 
        foreign key (SELLER_CUSTOMERNR) 
        references USERS (customerNr)
[main            ] DEBUG  - 18:27:01,775 - org.hibernate.SQL: 
    alter table USERS 
        add constraint UK_8a5ec890d05a4545a1e9660dea0 unique (customerNr)
On Oracle this fails, as the foreign key reference is actually checked before the UNIQUE constraint is generated.
http://www.techonthenet.com/oracle/errors/ora02270.php

Comment 2 Zbyněk Roubalík 2013-09-23 11:23:42 UTC
EAP 6.2.0.ER1


Note You need to log in before you can comment on or make changes to this bug.