Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351497 - JPA Entities from Tables shouldn't allow default packages
Summary: JPA Entities from Tables shouldn't allow default packages
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Tran Le CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 227851
  Show dependency tree
 
Reported: 2011-07-07 18:18 EDT by Chris Stodden CLA
Modified: 2012-03-21 13:55 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Stodden CLA 2011-07-07 18:18:34 EDT
Build Identifier: I20110613-1736

This is just something I keep forgetting when generating entities from tables.  Finish is enabled immediately upon selecting tables then end up with the classes in the default package which typically isn't optimal.

Reproducible: Always

Steps to Reproduce:
1.JPA Project
2.Right Click Project->JPA Tools->Generated Entities from Tables
3.Select any table, Finish
Comment 1 Neil Hauge CLA 2011-07-08 10:31:56 EDT
This bug is closely related to bug 227851.  There are a few different possible solutions to this issue.  We can disable the Finish button until you get to the wizard page that contains the Package setting, allowing you to see the warning for use of default package.  Another possibility is to prime the wizard with a default package name that could be removed or modified by the user, and allow the user to Finish from the first page.  It has also been discussed in the referenced by to have a preference for default package that can be set for adopters and users alike.
Comment 2 Chris Stodden CLA 2011-07-14 15:36:07 EDT
Thanks Neil,
Had I noticed that other bug, I probably would not have opened this one. I like the train of logic you suggest, it seems that holding up the Finish until a warning can be displayed seems like the least desirable option.  Also, the notification area at the top of the wizard pages seems to be limited in the number of separate messages that can be displayed.  So my vote would be for the default package preference.  Would that be exposed in such a way that other contributers could adopt that paradigm, that sounds interesting.
Comment 3 Neil Hauge CLA 2011-10-26 18:18:36 EDT
Retargeting this to Juno stream.
Comment 4 Neil Hauge CLA 2012-01-26 16:41:56 EST
An "Entity Generation From Tables" -> "Default package name" preference should be added to the JPA project properties.  This should also be a workspace level preference that can be overridden per project.  I'm open to suggestions on what the initial default would be.  My first stab would simply be "model", but perhaps we can do better.  By defining the preference, adopters could override this setting in adopter products.
Comment 5 Tran Le CLA 2012-03-08 16:19:56 EST
A "Default package" preference has been added at the workspace level preferences and can be overridden at the project level if needed. If there is no default package name specified, "model" will be used.

Fixed in M6.
Comment 6 Jolene Moffitt CLA 2012-03-21 13:55:19 EDT
Verified in Build S-3.4.0-20120319200442 

Verified a default package appears when you generate Entities from Tables for a JPA project.  Verified it can be changed in the Window>Preferences. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.2_M6