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 109092 - cmp from db wizard does not create all beans
Summary: cmp from db wizard does not create all beans
Status: RESOLVED WORKSFORME
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ jyothivasa
URL:
Keywords: RANDOM
: 109170 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-08 22:55 UTC by Kenneth Ganfield
Modified: 2008-11-08 01:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Ganfield 2007-07-08 22:55:49 UTC
Product Version: NetBeans IDE 6.0 M10 (build 200706281431) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb) Userdir:
/Applications/Netbeans_builds/userdirs/userdir6.0_m10

CMP Beans from DB wizard does not create beans for related tables

1. Create New 1.4 Project
2. Open CMP Beans from database wizard
3. Choose sample db
4. Choose Customer table. Discount_Code table is also shown as selected because it is related.
5. Click Next... finish wizard

The wizard only generates a bean for DiscountCode. No bean is created for Customer.

Also tried with other tables that have related tables with similar results. Seems that wizard will only create one bean
regardless of number of related tables.

Also, ejb-jar.xml does not contain information on CMP Relationships.
Comment 1 martin_adamek 2007-07-09 08:01:16 UTC
It works for me in latest daily build (please try there). Marking as random.
Comment 2 Kenneth Ganfield 2007-07-09 14:13:34 UTC
Product Version: NetBeans IDE Dev (Build 200707090000) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87 System:
Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb) Userdir: /Users/nb/.netbeans/dev

using more recent build, the IDE now creates the files and generates correct ejb-jar.xml

but i do get the following NPE:

java.lang.NullPointerException
	at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpFromDbGenerator.generateBeans(CmpFromDbGenerator.java:191)
	at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpGenerator.generateBeans(CmpGenerator.java:72)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:317)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.access$000(RelatedCMPWizard.java:58)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard$1.run(RelatedCMPWizard.java:233)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Comment 3 martin_adamek 2007-07-10 12:42:20 UTC
*** Issue 109170 has been marked as a duplicate of this issue. ***
Comment 4 _ jyothivasa 2008-11-08 01:22:16 UTC
This works for me on NB6.5 latest build running on Windows Vista. Is this a Mac thing? 
If so please re-open the bug with appropriate Platform set and detailed description on how to reproduce it.