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 154414 - Metadata API: Primary key needs getPosition()
Summary: Metadata API: Primary key needs getPosition()
Status: RESOLVED WORKSFORME
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-03 06:21 UTC by David Vancouvering
Modified: 2013-05-13 19:49 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Vancouvering 2008-12-03 06:21:18 UTC
Currently no way to get position of a primary key column in a primary key.
Comment 1 Jiri Rechtacek 2009-02-10 15:22:37 UTC
Reassigned to new owner.
Comment 2 matthias42 2013-05-13 19:49:05 UTC
From the API (org.netbeans.modules.db.metadata.model.api.PrimaryKey#getColumns):

"Get the list of columns for this primary key.  The collection is ordered based on the sequencing of the primary key."

So a user could be bold enough to cast to java.util.List other ordered collections don't seem to be to fitting. Guarded with an instanceof and a fallback to "List<Column> columns = new ArrayList<>(pk.getColumns())" should do it.