| Summary: | 'New JPA entity' wizard should accept short names for attribute types | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Stefan Dimov <stefan.dimov> | ||||||||
| Component: | Framework | Assignee: | Neil Hauge <neil.hauge> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | enhancement | ||||||||||
| Priority: | P3 | CC: | dimitar.giormov, kiril.mitov, neil.hauge | ||||||||
| Version: | unspecified | Keywords: | plan | ||||||||
| Target Milestone: | 2.3 M2 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | EaseOfUse | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Stefan Dimov
Maybe, it needs a little clarification: Actually, the wizard accepts any types. Even non-existing. The problem is that when you enter the type 'String' (short name only) the wizard accepts it and creates the java source without problems, but since this type was entered with short name only, the wizard doesn't recognize it as 'java.lang.String' and since not any class is allowed to be a type of an ID attribute, the wizard doesn't allow this attribute to be marked as ID. So, the request is actually the wizard not only to accept, but also to recognize the java.lang classes without typing their packages and thus allow this attributes to be marked as ID. It might make more sense to just allow users to pick any field as an ID, but have a status warning in the dialog indicating the problem with this. As an aside, we are missing this general validation outside of the wizard. The current UI of having a disabled, non-grayed check-box that the user cannot check for these invalid ID fields is awkward. We should at least be making it clear that these fields are not an option for ID if we are not going to let the user select them. Created attachment 143401 [details]
Allow entity PK of any type
1. Allows the user to enter java.lang classes with their short names (String, Long)
2. Allows attribute with any type to be marked as PK
3. If a certain attribute is marked as PK, but its type is not appropriate, shows warning in the wizard
4. The attribute type combo-box in the small dialog is replaced by a text box
5. The attribute type text box is enriched with auto-completion for the basic primitives and allowed types
Thanks for the patch Stefan. The described behavior sounds good - I'll take a look and test this out. In this patch the wizard seems to have problems handling primitives and fully qualified attribute types. Short names appear to be working well, but I can't get a primitive of fully qualified type to be set in the Entity fields table.
Also, a couple of items I noticed reviewing the code:
EntityDataModelProvider
I'm guessing this was a typo:
if (propertyName.equals(ENTITY_FIELDS) || propertyName.equals(ENTITY_FIELDS)) {
EntityRow
- might want to consider breaking up the setFqnTypeName into smaller chunks to help with the complexity of this method.
Created attachment 143476 [details]
Allow entity PK of any type V2
The second patch appears to be working well. I think the auto-completion is a big improvement over the combo box. I'm going to do some more testing today and will commit the patch assuming that I don't find any other issues. Thanks. Moving to M2 since the WTP schedule moved up one week for M1. Created attachment 144834 [details]
Version 3 of the patch
Improvements of the previous patch:
1. When an attribute of an invalid simple primary key type is checked as an id the message is error instead of warning
2. The text of the error message mentioned in 1. is slightly improved
Sorry for the delay on getting this in. Version 3 of the patch has been committed to head. Thanks for the contribution! |