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.
Summary: | Incorrectly generated entity class for PostgreSQL's table | ||
---|---|---|---|
Product: | db | Reporter: | Jan Stola <jstola> |
Component: | DB schema | Assignee: | Andrei Badea <abadea> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | emononen, pjiricka |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Jan Stola
2007-06-05 13:46:40 UTC
Seems that the generator gets confused when the name of the primary key field is in quotes, i.e. customer_id integer not null primary key works, but "customer_id" integer not null primary key does not. Reassigning to db/dbschema for further evaluation. The problem seems to be caused by that UniqueElement#getColumns().length is 0 for primary keys returned by TableElement#getPrimaryKey() when the name of the primary key is in quotes, whereas for names without quotes it is correctly 1. This confuses the entity generator so that it generates a separate PK class. I tested with PostgreSQL 8.2.4 and 8.2-505 JDBC 3 driver. Forgot to change the component, see above. The PostgreSQL driver quotes quoted index columns when returning them from DatabaseMetaData.getIndexInfo(). E.g. it returns "CUSTOMER_ID" instead of CUSTOMER_ID. Added some enhanced support for PostgreSQL, otherwise known as a hack. Also filed PostgreSQL bug 3480. Checking in src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java; /cvs/db/model/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java,v <-- TableElementImpl.java new revision: 1.6; previous revision: 1.5 done Marking as closed. |