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 237629 - The 'generate classes from database wizard' treats a regular table as a join (and does not generate a Class)
Summary: The 'generate classes from database wizard' treats a regular table as a join ...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Hibernate (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-24 15:42 UTC by jbril
Modified: 2014-01-30 03:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
picture of the PRICH databaseschema (32.65 KB, image/png)
2013-10-24 15:42 UTC, jbril
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jbril 2013-10-24 15:42:19 UTC
Created attachment 141529 [details]
picture of the PRICH databaseschema

I ran the wizard picking PRICH (and related tables) and expected it to generate (among others) classes Prich and PrichPK. But the table PRICH gets classed 'joinTable', which means that no Classes are generated.

Table PRICH' PK is the compound of the PK's of 2 related tables (PRIC & RICH).
PRICH has other fields (f.i. the field RESULT) (See attachment)

Pric, PricPK, Rich and RichPK are generated. PRIC, RICH and PRICH have the same common structure; A Pk that constitutes a join of two tables PLUS some other fields (see create statements).

create table PRIC (
Pid   numeric(19,0) not null  ,
Cid   numeric(19,0) not null  ,
Rid   int default 0 not null  ,
Hcp   float(16)         null  ,
PH    int               null  ,
Gp    int               null  ,
 PRIMARY KEY CLUSTERED ( Pid, Cid, Rid )  on 'default' 
)

create table RICH (
Cid   numeric(19,0) not null  ,
Rid   int default 0 not null  ,
Lid   numeric(19,0) not null  ,
Ss    int           not null  ,
No    int           not null  ,
Tid   int           not null  ,
NoR   int           null  ,
 PRIMARY KEY CLUSTERED ( Cid, Rid, Lid, Ss, No, Tid)  on 'default' 
)

create table PRICH (
Pid  numeric(19,0) not null  ,
Cid  numeric(19,0) not null  ,
Rid  int default 0 not null  ,
Lid  numeric(19,0) not null  ,
Ss   int           not null  ,
No   int           not null  ,
Tid  int           not null  ,
Result    int          null  ,
etc  varchar(255)      null  ,
 PRIMARY KEY CLUSTERED ( Pid, Cid, Rid, Lid, Ss, No, Tid )  on 'default' 
)

In the attached schema(RESULT.png) relationships are (left to right) (1 to n).

Thanks for your attention
Comment 1 Sergey Petrov 2014-01-29 14:18:03 UTC
the same columns are reused by 2 fks, it wasn't handed before
http://hg.netbeans.org/web-main/rev/ef3c6a75066d
Comment 2 Quality Engineering 2014-01-30 03:05:27 UTC
Integrated into 'main-silver', will be available in build *201401300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ef3c6a75066d
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #237629 check columns reusage in diferent fks