Bug 216915 - Open entities, generated from tables in their own java editor
Summary: Open entities, generated from tables in their own java editor
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-01-29 09:59 EST by Dimiter Dimitrov CLA
Modified: 2012-04-10 11:27 EDT (History)
2 users (show)

See Also:


Attachments
Open generated entitiies in the respective editors(for Java class) (15.02 KB, patch)
2008-01-29 09:59 EST, Dimiter Dimitrov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimiter Dimitrov CLA 2008-01-29 09:59:53 EST
Created attachment 88135 [details]
Open generated entitiies in the respective editors(for Java class)

When I'm generating entities from existing tables I faced that nothing suggests that something happened. I meet that when I invoke JPA Tools -> Generate Entities... the entity(s) are generated from the chosen tables, but focus is not set over the new created java classes. This is confusing for the developer. After discussion with our GUI usability experts and in accordance with common Eclipse / WTP behavior I’m suggesting the following solution (there is patch attached). The generated entity class/classes should be opened in the java editor(s). As some times the count of the generated artifacts is big, I have introduced a check box, which control whether this behavior is on/off. By default it is checked (on).
Important details:
1.	PackageGenerator.generateEntities() API method is adjusted to return collection with the names of the generated entities. As the method is static and its previous return type was void, the change keeps backward compatibility
2.	For the open action I have implemented a job, which rule is the same as the rule of GenerateEntitiesRunnable job, in order to wait for the resource generation
3.	The check box for the control of the open editor action is designed in the same style as “Synchronize Classes in persistence.xml”. I have respected the method name style too (Boolean return types was not marked with prefix is- or has-)
Could you comment the solution/fix, please? If you have some observation, I could improve it in way, preferred from you.
Comment 1 Max Rydahl Andersen CLA 2008-01-31 03:43:49 EST
Please don't have "Open all editors" by default. The user does not necessarilly know how many files there will be generated and opening just 3-4 editors would for me be seen as very disturbing in the ui..and if its a bit more like 8 it would remove all the editors i'm actively working on ....extremely annoying just because a directory got updated with some files.

Why not just open one of the files or show a dialog with the number of artifacts generated or something similar?
Comment 2 Neil Hauge CLA 2008-02-08 13:57:45 EST
I tend to agree with Max that having a completion dialog with the number of generated entities would be a better fit.  I am OK with the addition of the check box to open generated files, but I think we would want to have this off by default.

I think we tried to have a completion dialog initially, but there were problems getting it to work with the job implementation at the time.  I'm not sure if that is still an issue.
Comment 3 Neil Hauge CLA 2011-07-01 16:23:33 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 4 Neil Hauge CLA 2012-04-10 11:27:47 EDT
Comment on attachment 88135 [details]
Open generated entitiies in the respective editors(for Java class)

Marking this patch as obsolete.  Waiting for new patch with suggested changes.