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

Summary: New Entity Class from DB wizard should generate all classes or none
Product: javaee Reporter: Rochelle Raccah <raccah>
Component: PersistenceAssignee: Andrei Badea <abadea>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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