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 121426 - Created CRUD database (Derby client/Server) using wizard showed only some columns in resulting app
Summary: Created CRUD database (Derby client/Server) using wizard showed only some col...
Status: RESOLVED DUPLICATE of bug 105084
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Binding (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-07 23:45 UTC by dwanvik
Modified: 2007-11-09 12:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages log from when i ran wizard off books database (24.32 KB, text/plain)
2007-11-08 23:35 UTC, dwanvik
Details
books database (155.78 KB, application/x-gzip)
2007-11-08 23:38 UTC, dwanvik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dwanvik 2007-11-07 23:45:15 UTC
Using the services dialogue, and the Derby client driver,
having first started a Derby server from the tools menu, I make a table
with five column.
 
Then I used the app creation wizard to make a CRUD database, selecting the
same URL:

 "jdbc:derby://localhost:1527/books;create=true"

Connecting via Derby ij to inspect the table I can see all the columns: 

Running the generated app, I find that it ONLY SHOWS THE TWO
LAST of the five column in my table in the GUI window.

> describe books;
> COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
> ------------------------------------------------------------------------------
> AUTHORSURNAME       |VARCHAR  |NULL|NULL|128   |NULL      |256       |NO      
> AUTHORGIVENNAME     |VARCHAR  |NULL|NULL|128   |NULL      |256       |NO      
> TITLE               |VARCHAR  |NULL|NULL|128   |NULL      |256       |NO      
> CATEGORY            |VARCHAR  |NULL|NULL|20    |NULL      |40        |YES     
> COMMENTS            |VARCHAR  |NULL|NULL|128   |NULL      |256       |YES     
> 

The primary key was set as the three first columns. The app only shows the two
remaining columns. I used Java DB 10.3.1.4 and NB 6 beta 2.
Comment 1 David Vancouvering 2007-11-08 16:14:49 UTC
I'll work on reproducing this.  Meanwhile, Dag, can you please attach the message log.  It's under your userdir (usually
~/.netbeans/[version]), e.g. [userdir]/var/log/messages.log.

Comment 2 David Vancouvering 2007-11-08 16:47:42 UTC
Hi, Dag, I tried to reproduce this with toursdb.Address but couldn't.  Perhaps you can attach the books database you are
using?
Comment 3 dwanvik 2007-11-08 23:35:59 UTC
Created attachment 52763 [details]
messages log from when i ran wizard off books database
Comment 4 dwanvik 2007-11-08 23:38:27 UTC
Created attachment 52766 [details]
books database
Comment 5 dwanvik 2007-11-08 23:42:57 UTC
I notice that the generated DesktopApplication<n>View.java, the "Design" palette
only shows the two last columns as well, even though all columns were included
in the wizard dialogue.
Comment 6 David Vancouvering 2007-11-09 12:47:06 UTC
Yes, I was able to reproduce this with the BOOKS database.  I think it's because it has a compound key, which means that
the primary key is declared as an embedded id, see:

    @EmbeddedId
    protected BooksPK booksPK;
    @Column(name = "CATEGORY")
    private String category;
    @Column(name = "COMMENTS")

in Books.java

I think the beans binding code only binds with regular accessors, which is the last two columns (is my guess).

I'm reassigning to form/binding
Comment 7 David Vancouvering 2007-11-09 12:48:09 UTC
Fixed subcomponent
Comment 8 Jan Stola 2007-11-09 12:58:22 UTC
This is a known issue. Tables with compound primary key are not (well) supported by master/detail wizard e.g. table 
columns for key columns are not shown and it is not possible to create a new record because a new instance of the key 
is not created.

Note that you can customize the columns shown in the table using JTable customizer - invoke Table Contents ... action 
from contextual menu of JTable.

*** This issue has been marked as a duplicate of 105084 ***