Bug 244627 - Entity wizard not identifying when a key field is required
Summary: Entity wizard not identifying when a key field is required
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL: CSN 0120031469 2072550 2009
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-08-19 17:25 EDT by Carl Anderson CLA
Modified: 2011-07-01 16:26 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 Carl Anderson CLA 2008-08-19 17:25:12 EDT
STEPS:
1. create a 3.0 EJB project in a 5.0 EAR
2. Add the JPA facet
3. Bring up the new Entity wizard
4. specify a Class name and Java package

RESULT:
At this point can select Finish without having specified a key field on the next page of the wizard.
After selecting Finish, the following error appears in the Problems view:
Entity "..." has no Id or EmbeddedId.

It would be good if the wizard flagged when a key field is required so they can avoid the error.  That is, it's much easier to specify a key field in the wizard in response to an error at the top of the wizard then it is to subsequently define a field.  Alternatively, a user would have to define an ID or EmbeddedId annotation.

NOTE: if you define an entity that inherits from another entity via single table inheritance then in that case a key field is not required.  If that's true, then a message should only be issued when it is truly required.
Comment 1 Neil Hauge CLA 2008-08-26 18:04:36 EDT
A warning message in the wizard would be nice for this case.  Disabling the Finish button is probably too restrictive, but a warning would be good.
Comment 2 Carl Anderson CLA 2008-09-30 18:07:47 EDT
A warning would be acceptable.  Is there any chance of getting this fixed in the 2.0.3 release of Dali?
Comment 3 Neil Hauge CLA 2008-10-01 16:48:09 EDT
We have a release planned for this December, so October is our last month for active development on Dali 2.1.  As a result, we are trying to stay focused on 2.1 development and only work on the most serious items for maintenance.

If someone else is able to contribute this, we can certainly get it checked in for maintenance.  Otherwise we can take a quick look, but I can't make any promises.  It sounds like a quick change on the surface, but knowing when to display the message might make things a bit more complicated in the context of the wizard.
Comment 4 Neil Hauge CLA 2011-07-01 16:26:36 EDT
Moving JPA specific bugs to new JPA component in bugzilla.