Community
Participate
Working Groups
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.
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?
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.
Moving JPA specific bugs to new JPA component in bugzilla.
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.