This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 90520 - Entity classes can't recognize @OneToMany relationships with associated join tables
Summary: Entity classes can't recognize @OneToMany relationships with associated join ...
Status: RESOLVED DUPLICATE of bug 90962
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-04 14:41 UTC by xmaniac
Modified: 2007-02-15 15:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xmaniac 2006-12-04 14:41:34 UTC
When you try to automatically generate classes from database tables, if there is
a join table involved, Netbeans always creates a @ManytoMany annotation which is
not always the desired behaviour.

To reproduce:

1) Create database schema (ie in Oracle)

  create table A (a1 integer, a2 date, primary key (a1));
  create table B (b1 integer, b2 date, primary key (b1));
  create table A_B (a1 integer not null, b1 integer not null);
  alter table A_B add constraint uniqueB unique(b1);
  alter table A_B add constraint ab foreign key (a1) references A(a1);
  alter table A_B add constraint ba foreign key (b1) references B(b1);

2) Select New->Entity classes from Database
3) Look at the inferred code. The unique constraint that specifies a @OnetoMany
relationship between A and B couldn't be correctly processed.
Comment 1 Andrei Badea 2007-02-15 15:05:31 UTC
It seems this has been described and fixed as issue 90962. Thanks for filing it
anyway.


*** This issue has been marked as a duplicate of 90962 ***