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 172075 - generated PK files extremely unfriendly
Summary: generated PK files extremely unfriendly
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-12 02:40 UTC by err
Modified: 2016-07-07 08:54 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
ER diagram of part of schema (25.40 KB, image/png)
2009-09-12 02:42 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2009-09-12 02:40:53 UTC
Attached ER diagram. The table chart_has_event is an n:m mapping. Notice that most every table here has a foreign key to
chart_has_event. "entity class from databse" generates a different PK for each of these classes. That is decidedly not
useful. All the classes should use the same class to represent the primary key; then things like "equals" work and the
same PK class works to query multiple tables.

/db/ $ ls *PK*
AspectIdPK.java  ChartHasEventPK.java  PlanetIdPK.java  ProfilesPK.java
AspectsPK.java   EventOrderPK.java     ProfilePK.java
/db/ $ diff ChartHasEventPK.java EventOrderPK.java
30c30
< public class ChartHasEventPK implements Serializable {
---
> public class EventOrderPK implements Serializable {
38c38
<     public ChartHasEventPK() {
---
>     public EventOrderPK() {
41c41
<     public ChartHasEventPK(int chartId, int eventId) {
---
>     public EventOrderPK(int chartId, int eventId) {
72c72
<         if (!(object instanceof ChartHasEventPK)) {
---
>         if (!(object instanceof EventOrderPK)) {
75c75
<         ChartHasEventPK other = (ChartHasEventPK)object;
---
>         EventOrderPK other = (EventOrderPK)object;
87c87
<         return "org.metawb.astro.db.ChartHasEventPK[chartId=" + chartId +
---
>         return "org.metawb.astro.db.EventOrderPK[chartId=" + chartId +
Comment 1 err 2009-09-12 02:42:14 UTC
Created attachment 87532 [details]
ER diagram of part of schema
Comment 2 Sergey Petrov 2009-09-14 09:57:32 UTC
may be some analysis can be added to track such cases, but it looks more like enhancement for me.
Comment 3 Martin Balin 2016-07-07 08:54:49 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss