Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2012-10-05 19:25:16 +0000
committerNeil Hauge2012-10-05 19:27:50 +0000
commit90fab4dff643e8682ae91c0ef24b0bdaf042228a (patch)
tree42e78ae8a8049760e322714a43bf7a38555a74a6 /jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
parent6e8007d20e870b309813c6cb6bd2f7eb65640a3d (diff)
downloadwebtools.dali-90fab4dff643e8682ae91c0ef24b0bdaf042228a.tar.gz
webtools.dali-90fab4dff643e8682ae91c0ef24b0bdaf042228a.tar.xz
webtools.dali-90fab4dff643e8682ae91c0ef24b0bdaf042228a.zip
373582 - XML code completion for class references.
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
index 079dbf41dc..3dcd7dc0b1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
@@ -866,6 +866,13 @@ public abstract class AbstractOrmMultiRelationshipMapping<X extends AbstractXmlM
return this.getTargetEntityNonTransientAttributeNames();
}
+ @SuppressWarnings("unchecked")
+ protected Iterable<String> getCandidateMapKeyClassNames() {
+ return new CompositeIterable<String>(
+ MappingTools.getSortedJavaClassNames(getJavaProject()),
+ MappingTools.getPrimaryBasicTypeNames()
+ );
+ }
// ********** metamodel **********
@@ -1084,6 +1091,9 @@ public abstract class AbstractOrmMultiRelationshipMapping<X extends AbstractXmlM
if (this.mapKeyNameTouches(pos)) {
return this.getCandidateMapKeyNames();
}
+ if (this.mapKeyClassTouches(pos)) {
+ return this.getCandidateMapKeyClassNames();
+ }
result = this.mapKeyColumn.getCompletionProposals(pos);
if (result != null) {
return result;
@@ -1106,7 +1116,12 @@ public abstract class AbstractOrmMultiRelationshipMapping<X extends AbstractXmlM
}
protected boolean mapKeyNameTouches(int pos) {
- return this.xmlAttributeMapping.mapKeyNameTouches(pos);
+ return this.getXmlMapKey() == null? false : this.getXmlMapKey().mapKeyNameTouches(pos);
+ }
+
+ protected boolean mapKeyClassTouches(int pos) {
+ return this.xmlAttributeMapping.getMapKeyClass() == null ? false :
+ this.xmlAttributeMapping.getMapKeyClass().classNameTouches(pos);
}
// ********** abstract owner **********

Back to the top