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 75454 - New Entity Class from DB wizard should generate all classes or none
Summary: New Entity Class from DB wizard should generate all classes or none
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-25 02:13 UTC by Rochelle Raccah
Modified: 2007-07-31 12:44 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 Rochelle Raccah 2006-04-25 02:13:49 UTC
When there is a failure in the New Entity Class from DB wizard, generation stops
wherever the failure happened.  Some classes are correctly generated, some are
broken and just contain the Templates.Classes content from the original class
template.   From Jano:
I guess it's better to not generate anything...A general error dialog saying 
"Unexpected error when generating entity classes. No classes were generated."

The error message above is for the case when the exception doesn't have a
message, otherwise I propose:
"Error when generating entity classes: <exception message>. No classes were
generated."

Newlines in the messages must be worked out, and whether or not the class on
which it failed should be mentioned.

Note that after a discussion with Pavel, the simple solution of moving the
begin/end trans calls as well as the try/catch/finally was tried, but that was
not sufficient since all the Templates.Classes content files were then left over.
Comment 1 Andrei Badea 2006-05-29 14:21:38 UTC
Since the wizard only generates new files, perhaps maintaining a list of the
generated files would do.
Comment 2 Andrei Badea 2007-07-30 17:12:09 UTC
Yarda promised to look at it.
Comment 3 Andrei Badea 2007-07-30 17:13:20 UTC
Sorry, not at this one :-)
Comment 4 Andrei Badea 2007-07-31 12:44:48 UTC
Fixed.

Checking in src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGenerator.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/JavaPersistenceGenerator.java,v  <-- 
JavaPersistenceGenerator.java
new revision: 1.20; previous revision: 1.19
done