Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2009-11-18 17:16:54 -0500
committerkmoore2009-11-18 17:16:54 -0500
commitc2552a766bf55873afb3a763a115c414268fdf5f (patch)
tree6d83a44c3914afae7fc2c3c2555eccb7eb335fa9
parent0a82bcbecb20597a12de6300d75a76946e71797b (diff)
downloadwebtools.dali-c2552a766bf55873afb3a763a115c414268fdf5f.tar.gz
webtools.dali-c2552a766bf55873afb3a763a115c414268fdf5f.tar.xz
webtools.dali-c2552a766bf55873afb3a763a115c414268fdf5f.zip
refactored orphan-removal a little further to remove the 2_0 context model objects
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF1
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToManyMapping2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java2
21 files changed, 94 insertions, 676 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java
index 0a6383e75c..f0fcc2128c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.context.java;
+import org.eclipse.jpt.core.JptCorePlugin;
import org.eclipse.jpt.core.MappingKeys;
import org.eclipse.jpt.core.context.java.JavaOneToManyRelationshipReference;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
@@ -16,6 +17,7 @@ import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
+import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
import org.eclipse.jpt.core.resource.java.JPA;
import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
import org.eclipse.jpt.utility.internal.ArrayTools;
@@ -53,10 +55,18 @@ public abstract class AbstractJavaOneToManyMapping<T extends OneToManyAnnotation
@Override
protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
+ String[] annotationNames = ArrayTools.addAll(
super.buildSupportingAnnotationNames(),
JPA.JOIN_COLUMN,
JPA.JOIN_COLUMNS);
+
+ if (getJpaPlatformVersion().isCompatibleWithJpaVersion(JptCorePlugin.JPA_FACET_VERSION_2_0)) {
+ annotationNames = ArrayTools.addAll(
+ annotationNames,
+ JPA2_0.ONE_TO_MANY__ORPHAN_REMOVAL);
+ }
+
+ return annotationNames;
}
public String getKey() {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java
index c953dbfa88..1932fff04a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.context.java;
+import org.eclipse.jpt.core.JptCorePlugin;
import org.eclipse.jpt.core.MappingKeys;
import org.eclipse.jpt.core.context.java.JavaOneToOneRelationshipReference;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
@@ -17,6 +18,7 @@ import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
+import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
import org.eclipse.jpt.core.resource.java.JPA;
import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
import org.eclipse.jpt.utility.internal.ArrayTools;
@@ -59,12 +61,20 @@ public abstract class AbstractJavaOneToOneMapping
@Override
protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
+ String[] annotationNames = ArrayTools.addAll(
super.buildSupportingAnnotationNames(),
JPA.PRIMARY_KEY_JOIN_COLUMN,
JPA.PRIMARY_KEY_JOIN_COLUMNS);
+
+ if (getJpaPlatformVersion().isCompatibleWithJpaVersion(JptCorePlugin.JPA_FACET_VERSION_2_0)) {
+ annotationNames = ArrayTools.addAll(
+ annotationNames,
+ JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
+ }
+
+ return annotationNames;
}
-
+
public String getKey() {
return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java
index dd1f368aa6..6ee2dcdcf7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java
@@ -17,8 +17,6 @@ import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
import org.eclipse.jpt.core.context.java.JavaEmbeddable;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
@@ -30,8 +28,6 @@ import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaDerivedId2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaElementCollectionMapping2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaEmbeddable2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaMapsId2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOneToOneMapping2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOrphanRemoval2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaPersistentAttribute2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaPersistentType2_0;
@@ -132,16 +128,6 @@ public class GenericJpaFactory2_0
public JavaMapsId2_0 buildJavaMapsId(JavaSingleRelationshipMapping2_0 parent) {
return new GenericJavaMapsId2_0(parent);
}
-
- @Override
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToManyMapping2_0(parent);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToOneMapping2_0(parent);
- }
@Override
public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java
deleted file mode 100644
index 6d9db77d67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * GenericJavaOneToManyMapping2_0
- */
-public class GenericJavaOneToManyMapping2_0
- extends GenericJavaOneToManyMapping<OneToMany2_0Annotation>
-{
-
- // ********** constructor **********
- public GenericJavaOneToManyMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
- super.buildSupportingAnnotationNames(),
- JPA2_0.ONE_TO_MANY__ORPHAN_REMOVAL);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java
deleted file mode 100644
index 7112fbbfbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * GenericJavaOneToOneMapping2_0
- */
-public class GenericJavaOneToOneMapping2_0
- extends GenericJavaOneToOneMapping
-{
-
- // ********** constructor **********
- public GenericJavaOneToOneMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
- super.buildSupportingAnnotationNames(),
- JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java
index 67f80bd66b..781829d519 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java
@@ -33,23 +33,24 @@ public interface JPA2_0
String ACCESS__VALUE = "value";
String ASSOCIATION_OVERRIDE__JOIN_TABLE = "joinTable";
-
+
String CACHEABLE = PACKAGE_ + "Cacheable";
String CACHEABLE__VALUE = "value";
+ String ELEMENT_COLLECTION = PACKAGE_ + "ElementCollection";
+ String ELEMENT_COLLECTION__FETCH = "fetch";
+ String ELEMENT_COLLECTION__TARGET_CLASS = "targetClass";
+
String MAPS_ID = PACKAGE_ + "MapsId";
String MAPS_ID__VALUE = "value";
- String SEQUENCE_GENERATOR__CATALOG = "catalog";
- String SEQUENCE_GENERATOR__SCHEMA = "schema";
-
String ONE_TO_MANY__ORPHAN_REMOVAL = "orphanRemoval";
String ONE_TO_ONE__ORPHAN_REMOVAL = "orphanRemoval";
- String ELEMENT_COLLECTION = PACKAGE_ + "ElementCollection";
- String ELEMENT_COLLECTION__FETCH = "fetch";
- String ELEMENT_COLLECTION__TARGET_CLASS = "targetClass";
+ String SEQUENCE_GENERATOR__CATALOG = "catalog";
+ String SEQUENCE_GENERATOR__SCHEMA = "schema";
+
// JPA 2.0 enums
String ACCESS_TYPE = PACKAGE_ + "AccessType";
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF
index fdcd303e7b..4a98c4324c 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF
@@ -56,7 +56,6 @@ Export-Package: org.eclipse.jpt.eclipselink.core,
org.eclipse.jpt.eclipselink.core.internal.v1_1;x-internal:=true,
org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm;x-internal:=true,
org.eclipse.jpt.eclipselink.core.internal.v2_0;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java;x-internal:=true,
org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;x-internal:=true,
org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence;x-internal:=true,
org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.connection;x-internal:=true,
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
index bf2fd32edc..84031ccbfe 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
@@ -17,17 +17,17 @@ import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyMapping;
import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
+import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToManyMapping2_0;
import org.eclipse.jpt.utility.internal.ArrayTools;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
public class JavaEclipseLinkOneToManyMapping
extends AbstractJavaOneToManyMapping<OneToManyAnnotation>
- implements EclipseLinkOneToManyMapping
+ implements EclipseLinkOneToManyMapping2_0
{
protected final JavaEclipseLinkJoinFetch joinFetch;
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
index 2ba7c0a8ee..e790e8fe26 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
@@ -15,16 +15,16 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
+import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToOneMapping2_0;
import org.eclipse.jpt.utility.internal.ArrayTools;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
public class JavaEclipseLinkOneToOneMapping
extends AbstractJavaOneToOneMapping
- implements EclipseLinkOneToOneMapping
+ implements EclipseLinkOneToOneMapping2_0
{
protected final JavaEclipseLinkJoinFetch joinFetch;
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
index d513ca04a9..6fb099a2bb 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
@@ -40,6 +40,7 @@ import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
+import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
@@ -183,7 +184,7 @@ public class EclipseLinkOrmXmlContextNodeFactory extends AbstractOrmXmlContextNo
@Override
public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualEclipseLinkXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
+ return new VirtualEclipseLinkXmlOneToOne(ormTypeMapping, (JavaEclipseLinkOneToOneMapping) javaOneToOneMapping);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java
index 48d3a79021..0c5fce4c4e 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java
@@ -15,6 +15,9 @@ import org.eclipse.jpt.core.context.java.JavaJoinColumn;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinColumn;
import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToMany;
+import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
import org.eclipse.jpt.core.resource.orm.CascadeType;
import org.eclipse.jpt.core.resource.orm.FetchType;
import org.eclipse.jpt.core.resource.orm.MapKey;
@@ -222,4 +225,23 @@ public class VirtualEclipseLinkXmlOneToMany extends XmlOneToMany
public TextRange getPrivateOwnedTextRange() {
return null;
}
+
+ private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
+ return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
+ }
+
+ @Override
+ public Boolean getOrphanRemoval() {
+ JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
+ if (this.isOrmMetadataComplete()) {
+ return Boolean.valueOf(mappingsOrphanRemoval.isDefaultOrphanRemoval());
+ }
+ return Boolean.valueOf(mappingsOrphanRemoval.isOrphanRemoval());
+ }
+
+ @Override
+ public void setOrphanRemoval(Boolean newOrphanRemoval) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java
index 65935a463f..dbb904e5e2 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java
@@ -10,9 +10,11 @@
package org.eclipse.jpt.eclipselink.core.internal.context.orm;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToOne;
+import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
import org.eclipse.jpt.core.resource.orm.CascadeType;
import org.eclipse.jpt.core.resource.orm.FetchType;
import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
@@ -34,11 +36,11 @@ public class VirtualEclipseLinkXmlOneToOne extends XmlOneToOne
{
protected OrmTypeMapping ormTypeMapping;
- protected final JavaOneToOneMapping javaAttributeMapping;
+ protected final JavaEclipseLinkOneToOneMapping javaAttributeMapping;
protected final VirtualXmlOneToOne virtualXmlOneToOne;
- public VirtualEclipseLinkXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
+ public VirtualEclipseLinkXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToOneMapping javaOneToOneMapping) {
super();
this.ormTypeMapping = ormTypeMapping;
this.javaAttributeMapping = javaOneToOneMapping;
@@ -154,7 +156,7 @@ public class VirtualEclipseLinkXmlOneToOne extends XmlOneToOne
if (isOrmMetadataComplete()) {
return null; //don't return default value, it only applies for an empty @JoinFetch
}
- return EclipseLinkJoinFetchType.toOrmResourceModel(((JavaEclipseLinkOneToOneMapping) this.javaAttributeMapping).getJoinFetch().getValue());
+ return EclipseLinkJoinFetchType.toOrmResourceModel((this.javaAttributeMapping).getJoinFetch().getValue());
}
@Override
@@ -167,7 +169,7 @@ public class VirtualEclipseLinkXmlOneToOne extends XmlOneToOne
if (isOrmMetadataComplete()) {
return false;
}
- return ((JavaEclipseLinkOneToOneMapping) this.javaAttributeMapping).getPrivateOwned().isPrivateOwned();
+ return (this.javaAttributeMapping).getPrivateOwned().isPrivateOwned();
}
@Override
@@ -200,4 +202,24 @@ public class VirtualEclipseLinkXmlOneToOne extends XmlOneToOne
public TextRange getPrivateOwnedTextRange() {
return null;
}
+
+
+ private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToManyMapping) {
+ return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
+ }
+
+ @Override
+ public Boolean getOrphanRemoval() {
+ JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
+ if (this.isOrmMetadataComplete()) {
+ return Boolean.valueOf(mappingsOrphanRemoval.isDefaultOrphanRemoval());
+ }
+ return Boolean.valueOf(mappingsOrphanRemoval.isOrphanRemoval());
+ }
+
+ @Override
+ public void setOrphanRemoval(Boolean newOrphanRemoval) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java
index ab381874aa..768b0e1827 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java
@@ -27,6 +27,7 @@ import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
+import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlContextNodeFactory;
@@ -97,7 +98,7 @@ public class EclipseLinkOrmXml1_1ContextNodeFactory extends EclipseLinkOrmXmlCon
@Override
public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualEclipseLinkXmlOneToOne1_1(ormTypeMapping, javaOneToOneMapping);
+ return new VirtualEclipseLinkXmlOneToOne1_1(ormTypeMapping, (JavaEclipseLinkOneToOneMapping) javaOneToOneMapping);
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java
index c3f85779eb..63cde7bdfd 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
import org.eclipse.jpt.core.resource.orm.AccessType;
import org.eclipse.jpt.core.resource.orm.CascadeType;
@@ -19,6 +18,7 @@ import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToOne;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
@@ -33,11 +33,11 @@ public class VirtualEclipseLinkXmlOneToOne1_1 extends XmlOneToOne
{
protected OrmTypeMapping ormTypeMapping;
- protected final JavaOneToOneMapping javaAttributeMapping;
+ protected final JavaEclipseLinkOneToOneMapping javaAttributeMapping;
protected final VirtualEclipseLinkXmlOneToOne virtualXmlOneToOne;
- public VirtualEclipseLinkXmlOneToOne1_1(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
+ public VirtualEclipseLinkXmlOneToOne1_1(OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToOneMapping javaOneToOneMapping) {
super();
this.ormTypeMapping = ormTypeMapping;
this.javaAttributeMapping = javaOneToOneMapping;
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java
index 663dc1e80f..93d296b724 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java
@@ -16,8 +16,6 @@ import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
@@ -49,8 +47,6 @@ import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToOneMapping2_0;
/**
* EclipseLink2_0JpaFactory
@@ -115,17 +111,7 @@ public class EclipseLink2_0JpaFactory
public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent) {
return new GenericJavaSequenceGenerator2_0(parent);
}
-
- @Override
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToManyMapping2_0(parent);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToOneMapping2_0(parent);
- }
-
+
@Override
public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
return new GenericJavaCacheable2_0(parent);
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToManyMapping2_0.java
deleted file mode 100644
index f19eca56bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToManyMapping2_0.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * JavaEclipseLinkOneToManyMapping2_0
- */
-public class JavaEclipseLinkOneToManyMapping2_0
- extends JavaEclipseLinkOneToManyMapping
- implements EclipseLinkOneToManyMapping2_0
-{
-
- // ********** constructor **********
- public JavaEclipseLinkOneToManyMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
- super.buildSupportingAnnotationNames(),
- JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java
deleted file mode 100644
index f6e36b7a69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * JavaEclipseLinkOneToOneMapping2_0
- */
-public class JavaEclipseLinkOneToOneMapping2_0
- extends JavaEclipseLinkOneToOneMapping
- implements EclipseLinkOneToOneMapping2_0
-{
-
- // ********** constructor **********
- public JavaEclipseLinkOneToOneMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
- super.buildSupportingAnnotationNames(),
- JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
index d66cf5522e..d722619e3a 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
@@ -18,8 +18,6 @@ import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
import org.eclipse.jpt.core.context.java.JavaIdMapping;
import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
import org.eclipse.jpt.core.context.java.JavaTransientMapping;
import org.eclipse.jpt.core.context.java.JavaVersionMapping;
import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
@@ -40,7 +38,6 @@ import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmOrphanRemoval2_0
import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmSequenceGenerator2_0;
import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlAssociationOverride2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedId2_0;
@@ -76,7 +73,6 @@ import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipse
import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlTransient1_1;
import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlVariableOneToOne1_1;
import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlVersion1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToManyMapping2_0;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
@@ -86,8 +82,6 @@ import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
@@ -136,6 +130,7 @@ public class EclipseLinkOrmXml2_0ContextNodeFactory extends EclipseLinkOrmXmlCon
return new GenericOrmCacheable2_0(parent, resource);
}
+ @Override
public OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable2_0 resource) {
return new GenericOrmOrphanRemoval2_0(parent, resource);
}
@@ -172,15 +167,6 @@ public class EclipseLinkOrmXml2_0ContextNodeFactory extends EclipseLinkOrmXmlCon
return new VirtualEclipseLinkXmlManyToOne1_1(ormTypeMapping, javaManyToOneMapping);
}
- @Override
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- return new VirtualEclipseLinkXmlOneToMany2_0(ormTypeMapping, (JavaEclipseLinkOneToManyMapping2_0) javaOneToManyMapping);
- }
-
- @Override
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualEclipseLinkXmlOneToOne2_0(ormTypeMapping, (JavaOneToOneMapping2_0) javaOneToOneMapping);
- }
@Override
public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java
deleted file mode 100644
index f92eb81026..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualEclipseLinkXmlOneToMany2_0
- */
-public class VirtualEclipseLinkXmlOneToMany2_0 extends XmlOneToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkOneToManyMapping2_0 javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlOneToMany virtualXmlOneToMany;
-
- public VirtualEclipseLinkXmlOneToMany2_0(
- OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToManyMapping2_0 javaOneToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToManyMapping;
- this.virtualXmlOneToMany = new VirtualEclipseLinkXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToMany.setCascade(value);
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
- if (this.isOrmMetadataComplete()) {
- return mappingsOrphanRemoval.isDefaultOrphanRemoval();
- }
- return mappingsOrphanRemoval.isOrphanRemoval();
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlOneToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlOneToMany.setMapKey(value);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlOneToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlOneToMany.setOrderBy(value);
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToMany.getTargetEntityTextRange();
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToMany.getJoinColumns();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.virtualXmlOneToMany.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.virtualXmlOneToMany.setJoinFetch(value);
- }
-
- @Override
- public boolean isPrivateOwned() {
- return this.virtualXmlOneToMany.isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- this.virtualXmlOneToMany.setPrivateOwned(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlOneToMany.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlOneToMany.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlOneToMany.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.virtualXmlOneToMany.getJoinFetchTextRange();
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return this.virtualXmlOneToMany.getPrivateOwnedTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java
deleted file mode 100644
index 83a796091a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualEclipseLinkXmlOneToOne2_0
- */
-public class VirtualEclipseLinkXmlOneToOne2_0 extends XmlOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaOneToOneMapping2_0 javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlOneToOne virtualXmlOneToOne;
-
- public VirtualEclipseLinkXmlOneToOne2_0(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping2_0 javaOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToOneMapping;
- this.virtualXmlOneToOne = new VirtualEclipseLinkXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlOneToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlOneToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToOne.setCascade(value);
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
- if (this.isOrmMetadataComplete()) {
- return mappingsOrphanRemoval.isDefaultOrphanRemoval();
- }
- return mappingsOrphanRemoval.isOrphanRemoval();
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToOne.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToOne.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToOne.setMappedBy(value);
- }
-
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- return this.virtualXmlOneToOne.getPrimaryKeyJoinColumns();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToOne.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.virtualXmlOneToOne.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.virtualXmlOneToOne.setJoinFetch(value);
- }
-
- @Override
- public boolean isPrivateOwned() {
- return this.virtualXmlOneToOne.isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- this.virtualXmlOneToOne.setPrivateOwned(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlOneToOne.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlOneToOne.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlOneToOne.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.virtualXmlOneToOne.getJoinFetchTextRange();
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return this.virtualXmlOneToOne.getPrivateOwnedTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java
index d4f0c9dea0..10e857ddbf 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java
@@ -56,7 +56,7 @@ public class OrphanRemoval2_0Composite extends FormPane<OrphanRemovable2_0>
protected void initializeLayout(Composite container) {
this.addTriStateCheckBoxWithDefault(
- this.addSubPane(container, 4),
+ container,
JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabel,
this.buildOrphanRemovalHolder(),
this.buildOrphanRemovalStringHolder(),

Back to the top