| Summary: | code completion proposals in JPA XML Mapping file | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Karen Butzke <karenfbutzke> | ||||||||||
| Component: | JPA | Assignee: | Nan Li <nan.n.li> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | enhancement | ||||||||||||
| Priority: | P3 | CC: | mlists, neil.hauge, paul.fullbright, thatnitind | ||||||||||
| Version: | 1.0 | Keywords: | plan | ||||||||||
| Target Milestone: | 3.2 M6 | Flags: | neil.hauge:
review+
|
||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows XP | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Karen Butzke
Proposed for 2.0. I'm not sure I understand the request. Could someone explain it some more? Ran out of time for this in 2.0. Will look at this for the next feature release. This feature involves providing code assist for XML attributes and element values where the Dali JPA model can provide assistance, similar to the support we provide in Java Entities. According to a forum post (http://www.eclipse.org/forums/index.php?t=msg&th=165775&start=0&) there is now extension support for xml content assist in wtp. I think we should consider this for the next release Moving JPA specific bugs to new JPA component in bugzilla. Created attachment 211221 [details]
proposed patch
Besides columns, tables, etc mentioned in the bug description, content assist for the following items (not exhausted) is also supported: - schema, category, package element of entity-mappings - elements of persistence-unit-metadata - type mapping classes - attribute mapping names - association-override names - unique-constraint columns - generated-value - convert element ... ... Please let me know if anything should be there, but not. Thanks! Created attachment 211771 [details]
proposed patch
merged with the latest HEAD code
Created attachment 211772 [details]
proposed patch
attached as patch file
Review: In general, things look pretty good. Testing has only turned up a couple of issues which are covered below. JpaXmlStructureNode -Class header should be corrected with accurate date and version references AbstractOrmPersistenceUnitDefaults -schemaTouches() and catalogTouches() methods need to check for null xmlDefaults to avoid NPE. DefaultJpaXmlCompletionProposalComputer -Was thinking this class should either be removed or commented further to indicate that its existence is needed to isolate WTP code that will be removed pending the referenced bug fix. Most of that is there in the comments, but maybe just add the part about isolating the WTP code so it can be more easily removed. When it can be removed, we should try to eliminate the subclassing of this "default" implementation. -If this class stays (which I think is fine for now) it will need a license header JpaXmlCompletionProposalComputer computeCompletionProposals() -In general we don't want swallow RuntimeExceptions except for very special conditions. The question is whether this situation is similar to the Java completion situation. I think that this is a bit different given the more synchronous nature of XML editing. Since there is no delay, it may be less likely to be in a bad state at the time of invoking content assist. Also, for testing purposes I think it would make sense to at least log errors until we lock down for the release. Please add: JptJpaUiPlugin.log(ex); before returning the empty list -Also, there should be a comment any time a general rule is broken, such as swallowing a runtime exception. Please add a comment explaining why we are doing what we are doing in regard to exception handling in computeCompletionProposals(). Created attachment 212164 [details]
proposed patch
incorporated Neil's comments
Changes committed to head for M6. |