reversing that expiriment, not surprisingly it didn't work
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.core/plugin.xml
index 2b4dfba..0894b9d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.core/plugin.xml
@@ -15,7 +15,7 @@
<!-- ***** Eclipse core extensions ***** -->
<extension
- point="org.eclipse.core.contenttype.contentTypes">
+ point="org.eclipse.core.runtime.contentTypes">
<!-- "abstract" content type to be extended by all JPA XML file content types -->
<content-type
@@ -25,11 +25,18 @@
describer="org.eclipse.jpt.core.internal.resource.IndeterminateContentDescriber">
</content-type>
+ <!-- "abstract" persistence file content type -->
+ <content-type
+ id="org.eclipse.jpt.core.content.persistenceFile"
+ name="%PERSISTENCE_FILE_CONTENT"
+ base-type="org.eclipse.jpt.core.content.baseJpaContent">
+ </content-type>
+
<!-- persistence.xml version 1.0 content type -->
<content-type
id="org.eclipse.jpt.core.content.persistence"
name="%PERSISTENCE_XML_CONTENT"
- base-type="org.eclipse.jpt.core.content.baseJpaContent"
+ base-type="org.eclipse.jpt.core.content.persistenceFile"
file-names="persistence.xml">
<describer
class="org.eclipse.jpt.core.internal.resource.xml.XMLRootElementVersionContentDescriber">
@@ -43,7 +50,7 @@
<content-type
id="org.eclipse.jpt.core.content.persistence2_0"
name="%PERSISTENCE2_0_XML_CONTENT"
- base-type="org.eclipse.jpt.core.content.persistence"
+ base-type="org.eclipse.jpt.core.content.persistenceFile"
file-names="persistence.xml">
<describer
class="org.eclipse.jpt.core.internal.resource.xml.XMLRootElementVersionContentDescriber">
@@ -54,11 +61,18 @@
</describer>
</content-type>
+ <!-- "abstract" mapping file content type -->
+ <content-type
+ id="org.eclipse.jpt.core.content.mappingFile"
+ name="%MAPPING_FILE_CONTENT"
+ base-type="org.eclipse.jpt.core.content.baseJpaContent">
+ </content-type>
+
<!-- orm.xml version 1.0 content type -->
<content-type
id="org.eclipse.jpt.core.content.orm"
name="%ORM_XML_CONTENT"
- base-type="org.eclipse.jpt.core.content.baseJpaContent">
+ base-type="org.eclipse.jpt.core.content.mappingFile">
<describer
class="org.eclipse.jpt.core.internal.resource.xml.XMLRootElementVersionContentDescriber">
<parameter
@@ -69,9 +83,9 @@
<!-- orm.xml version 2.0 content type -->
<content-type
+ base-type="org.eclipse.jpt.core.content.mappingFile"
id="org.eclipse.jpt.core.content.orm2_0"
- name="%ORM2_0_XML_CONTENT"
- base-type="org.eclipse.jpt.core.content.orm">
+ name="%ORM2_0_XML_CONTENT">
<describer
class="org.eclipse.jpt.core.internal.resource.xml.XMLRootElementVersionContentDescriber">
<parameter
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
index fd1a9fd..35dcddf 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
@@ -114,6 +114,11 @@
* The content type for Java source code files.
*/
public static final IContentType JAVA_SOURCE_CONTENT_TYPE = getContentType(JavaCore.JAVA_SOURCE_CONTENT_TYPE);
+
+ /**
+ * The base content type for all persistence.xml files.
+ */
+ public static final IContentType PERSISTENCE_FILE_CONTENT_TYPE = getJpaContentType("persistenceFile"); //$NON-NLS-1$
/**
* The content type for persistence.xml 1.0 (based on the persistence 1.0 schema) files.
@@ -124,7 +129,12 @@
* The content type for persistence.xml 2.0 (based on the persistence 2.0 schema) files.
*/
public static final IContentType PERSISTENCE2_0_XML_CONTENT_TYPE = getJpaContentType("persistence2_0"); //$NON-NLS-1$
-
+
+ /**
+ * The base content type for all mapping files.
+ */
+ public static final IContentType MAPPING_FILE_CONTENT_TYPE = getJpaContentType("mappingFile"); //$NON-NLS-1$
+
/**
* The content type for orm.xml 1.0 (based on the orm 1.0 schema) mapping files.
*/
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java
index 08e4a79..66dc03c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java
@@ -656,7 +656,7 @@
public JpaXmlResource getPersistenceXmlResource() {
return (JpaXmlResource) this.getResourceModel(
JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH,
- JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE
+ JptCorePlugin.PERSISTENCE_FILE_CONTENT_TYPE
);
}
@@ -665,7 +665,7 @@
}
public JpaXmlResource getMappingFileXmlResource(String fileName) {
- return (JpaXmlResource) this.getResourceModel(fileName, JptCorePlugin.ORM_XML_CONTENT_TYPE);
+ return (JpaXmlResource) this.getResourceModel(fileName, JptCorePlugin.MAPPING_FILE_CONTENT_TYPE);
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXml.java
index 79fccfa..475d3d4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXml.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXml.java
@@ -39,7 +39,7 @@
public AbstractOrmXml(MappingFileRef parent, JpaXmlResource resource) {
super(parent);
- if (!resource.getContentType().isKindOf(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
+ if (!resource.getContentType().isKindOf(JptCorePlugin.MAPPING_FILE_CONTENT_TYPE)) {
throw new IllegalArgumentException(resource + " does not have mapping file content type"); //$NON-NLS-1$
}
this.xmlResource = resource;
@@ -139,7 +139,7 @@
// ********** updating **********
public void update(JpaXmlResource resource) {
- if (!resource.getContentType().isKindOf(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
+ if (!resource.getContentType().isKindOf(JptCorePlugin.MAPPING_FILE_CONTENT_TYPE)) {
throw new IllegalArgumentException(resource + " does not have mapping file content type"); //$NON-NLS-1$
}
this.xmlResource = resource;