Community
Participate
Working Groups
bug 188940 covered all of the content assist in XML that we provide in Java. This does not include content assist for class references since in Java those are done by JDT. We can call this phase 2 for XML content assist. 1. relationship mappings: target-entity - java classes + persistent types in orm.xml 2. collection mappings: map-key-class - java classes + primitives + persistent types in orm.xml 3. element-collection: target-class - java classes + primitives + persistent types in orm.xml 4. entity, mapped-superclass, embeddable class proposals need to include all Classes on the classpath. Also should not limit the choices to those those classes that are in the package specified by the package element 5. converter classes, customizer, id-class, probably more These are new with dynamic persistence support: 1. attribute-type - this should include all classes, plus primitives. for some mappings this could also includes persistent types listed in the orm.xml since they won't have a corresponding java class 2. parent-class - all java classes + persistent types in the orm.xml
Created attachment 219539 [details] proposed patch First git patch and hope it works. :)
Can you confirm that the applicable JUnit tests pass and give a brief technical description of the changes. Thanks!
Yes, JUnit tests all passed. The implementation is pretty much the same as what described in the bug description except for attribute-type. Code assist for attribute-type works as the following: 1. collection mappings and array mapping: collection types - Collection, List, Map, and Set. 2. embedded, embedded-id and structure mappings: all Java classes + persistent types in the eclipelink_orm.xml 3. version mapping: int, Integer, short, Short, long, Long, Timestamp since the spec says only these types are supported for version properties 4. variable-one-to-one mapping: does not have attribute-type attribute but target-interface whose completion proposals include all Java classes 5. transformation mapping: all Java classes + primitives + collection types + persistent types in the eclipelink_orm.xml (not 100% sure what should be included, but thinking maybe all the types could be transformed) 6. basic and id mapping: primitives 7. 1-1, m-1, basic-map, basic-collection and transient mappings don't have attribute-type attribute. Notes: 1. Code assist is available for class-extractor element on entity and the completion proposals are all Java classes. 2. Completion proposals are sorted based on groups (Java classes, primitives, collection types, or dynamic persistent types), not all the proposals as a whole to give a better idea where these proposals are from. 3. Code assist is not available for partitioning, entity-listener, cache-interceptor, copy-policy due to lacking of context model support. A separate enhancement will be opened to track that. 4. No public API is added. 5. Java classes don't include the ones from jar files. 6. Package element isn't considered when providing the candidate class references in this implementation. Maybe later?
I've only found one issue from a functional standpoint. Basic mapping attribute-type assist is currently limited to primitives + String. I would expect to see primitive wrappers and the other specific types mentioned in the spec (such as java.util.Date).
Created attachment 220692 [details] proposed patch This patch includes - incorporated Karen's changes to code assist (changed method name) - incorporated Neil's review comments - made changes to a couple of methods of MappingTools class
The latest patch is based on the following commit: 9758de6 support for versionless xml files Paul Fullbright
Created attachment 221807 [details] NPE when trying to complete "class" value for "partitioning" which may not be directly supported Received this NPE when trying to complete "class" value for "partitioning" which may not be something directly supported by this functionality.
In reference to my last comment, it seems that where content assist is not yet supported, such as partitioning or transformer-class, an NPE is encountered.
Created attachment 221855 [details] proposed patch This patch - fixed the NPE problem - added missing part for converters including code assist for default-object-value of object-type-converter - provided only interfaces for target-interface attribute of variable-one-to-one and is based on the following commit: 575902e Fix bug#386416 - query text area in JPA Details View should be larger Pascal Filion
Patch committed with some modifications, mostly in the MappingTools class. There are some limitations to this support, such is assist for areas where we currently have no model.