summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Filion2013-08-23 11:39:21 (EDT)
committerNeil Hauge2013-08-23 11:40:11 (EDT)
commitc667eb851329c8bdb8ee46e9c0de8f15dd342f08 (patch)
treeac79781c8067cf79f69b374b2ccf117f5d56ceda
parent99039d2270f0e5d5e9733afded03d00b36b474af (diff)
downloadwebtools.dali-c667eb851329c8bdb8ee46e9c0de8f15dd342f08.zip
webtools.dali-c667eb851329c8bdb8ee46e9c0de8f15dd342f08.tar.gz
webtools.dali-c667eb851329c8bdb8ee46e9c0de8f15dd342f08.tar.bz2
411118 - Fix JPQL validation and content assist in dynamic entities.
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java
index 1cff783..7c929b1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java
@@ -16,8 +16,8 @@ package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
import java.lang.annotation.Annotation;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.SpecifiedPersistentAttribute;
import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
+import org.eclipse.jpt.jpa.core.context.SpecifiedPersistentAttribute;
import org.eclipse.jpt.jpa.core.jpql.spi.JpaTypeDeclaration;
import org.eclipse.jpt.jpa.core.jpql.spi.JpaTypeRepository;
import org.eclipse.persistence.jpa.jpql.tools.spi.IEntity;
@@ -34,7 +34,7 @@ import org.eclipse.persistence.jpa.jpql.tools.spi.ITypeDeclaration;
* to solicit feedback from pioneering adopters on the understanding that any code that uses this
* API will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.2
+ * @version 3.3
* @since 3.2
* @author Pascal Filion
*/
@@ -106,6 +106,7 @@ public class EclipseLinkDynamicMapping implements IMapping {
*/
protected IType buildType() {
+ // TODO: This section might not be required anymore if getTypeName() works correctly
if (delegate.isCollection() ||
delegate.isRelationship()) {
@@ -200,6 +201,14 @@ public class EclipseLinkDynamicMapping implements IMapping {
* @return The fully qualified type name
*/
public String getTypeName() {
+
+ if (delegate.isCollection() ||
+ delegate.isRelationship()) {
+
+ RelationshipMapping mapping = (RelationshipMapping) getAttribute().getMapping();
+ return mapping.getFullyQualifiedTargetEntity();
+ }
+
return getAttribute().getTypeName();
}