Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 195251 - DBSchema interprets index statistics as real indices (creates wrong composited key in entity beans)
DBSchema interprets index statistics as real indices (creates wrong composite...
Status: RESOLVED FIXED
Product: db
Classification: Unclassified
Component: DB schema
7.0
PC Linux
: P3 (vote)
: 7.0
Assigned To: Jiri Rechtacek
issues@db
: NETFIX
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-09 20:23 UTC by matthias42
Modified: 2011-02-16 11:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
patch against dbschema (1.11 KB, patch)
2011-02-09 20:23 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description matthias42 2011-02-09 20:23:32 UTC
Created attachment 105802 [details]
patch against dbschema

Hey,

when generating entity beans from database I noticed wrongly generated composited keys. I could track this issue down to the dbschama in which the indices are queried from the jdbc metadata. So far so good, but then rows marked as statistics are considered valid index data.

I had a similar problem when building a db visualisier.

Please see the attached patch. It just skips the statistics rows. A further going patch making use of the corresponing functions in jdbc might be good, but this fix should be valid in the current logic.

This is a small example:

CREATE  TABLE  Antwort_element (

  id serial NOT NULL ,

  text LVARCHAR(1024) ,

  Fragebogen_element_id INT NOT NULL ,

  zahl INT ,

  Antwort_fragebogen_id INT NOT NULL ,

  PRIMARY KEY (id))

;


This created on an informix 11.5/11.7 database produces an entity with a composite primary key. With the attached patch the primary key is correctly reproduced.
Comment 1 Jiri Rechtacek 2011-02-15 07:19:57 UTC
Thanks for the patch, was applied by core-main/rev/6f8d9ff8335f
Comment 2 Jiri Kovalsky 2011-02-15 09:13:38 UTC
Thanks Jirko for review and integration and especially thanks you Matthias for the patch! I added the issue to the NetFIX Pool.

http://wiki.netbeans.org/NetFIXIssues
Comment 3 Quality Engineering 2011-02-16 11:40:09 UTC
Integrated into 'main-golden', will be available in build *201102160501* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6f8d9ff8335f
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #195251: DBSchema interprets index statistics as real indices (creates wrong composited key in entity beans);
applied matthias42's patch


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo