Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2011-08-16 12:46:10 -0400
committerkmoore2011-08-16 12:46:10 -0400
commit57241c4c8abbbcd876ca5b91846cb73e2a8348a4 (patch)
tree00d51efa2f3026967f89fc0df24c1093bba6e479
parentf7810d0561c2c4bf4a435fc949bbfcf26df07349 (diff)
downloadwebtools.dali-57241c4c8abbbcd876ca5b91846cb73e2a8348a4.tar.gz
webtools.dali-57241c4c8abbbcd876ca5b91846cb73e2a8348a4.tar.xz
webtools.dali-57241c4c8abbbcd876ca5b91846cb73e2a8348a4.zip
added getJavaResourceType() API to TypeMapping
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaTypeMapping.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java2
3 files changed, 10 insertions, 6 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java
index 827961d571..66793e6cc0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.context;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.db.Schema;
@@ -24,7 +25,7 @@ import org.eclipse.jpt.jpa.db.Schema;
* adopters on the understanding that any code that uses this API will almost
* certainly be broken (repeatedly) as the API evolves.
*
- * @version 2.3
+ * @version 3.1
* @since 2.0
*/
public interface TypeMapping
@@ -33,6 +34,12 @@ public interface TypeMapping
PersistentType getPersistentType();
/**
+ * Return the corresponding java resource type, this can be null
+ */
+ JavaResourceType getJavaResourceType();
+
+
+ /**
* Return a unique key for the type mapping. If this is defined in an
* extension they should be equal.
*/
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaTypeMapping.java
index c03af30914..63e7a91a40 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaTypeMapping.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jpa.core.context.java;
import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jpa.core.context.TypeMapping;
/**
@@ -22,14 +21,12 @@ import org.eclipse.jpt.jpa.core.context.TypeMapping;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 2.3
+ * @version 3.1
* @since 2.0
*/
public interface JavaTypeMapping
extends TypeMapping, JavaJpaContextNode
{
- JavaResourceType getJavaResourceType();
-
Annotation getMappingAnnotation();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java
index c2125fd97b..240b2dd581 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java
@@ -185,7 +185,7 @@ public abstract class AbstractOrmTypeMapping<X extends XmlTypeMapping>
return this.getPersistentType().getJavaPersistentType();
}
- protected JavaResourceType getJavaResourceType() {
+ public JavaResourceType getJavaResourceType() {
JavaPersistentType javaType = this.getJavaPersistentType();
return (javaType == null) ? null : javaType.getJavaResourceType();
}

Back to the top