diff options
author | kmoore | 2012-03-21 17:00:43 +0000 |
---|---|---|
committer | kmoore | 2012-03-21 17:00:43 +0000 |
commit | aaad3e378bcf6326506ba665c34364c76435f74c (patch) | |
tree | 07d8aa47679a7026020dbbb1022a306dcfc419b3 | |
parent | 7fa729187005992fe97741fbb60dc0c60f6e7eee (diff) | |
download | webtools.dali-aaad3e378bcf6326506ba665c34364c76435f74c.tar.gz webtools.dali-aaad3e378bcf6326506ba665c34364c76435f74c.tar.xz webtools.dali-aaad3e378bcf6326506ba665c34364c76435f74c.zip |
Bug 371112 - EclipseLink converter validation appearing on xml, when converter defined in java - patch from Nan
21 files changed, 265 insertions, 55 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java index 0f762480e9..ffe04e56f7 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Oracle. All rights reserved. + * Copyright (c) 2011, 2012 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. @@ -24,7 +24,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMappin * @since 3.2 */ public interface EclipseLinkJavaConvertibleMapping - extends EclipseLinkConvertibleMapping, JavaEclipseLinkConverterContainer.Owner + extends EclipseLinkConvertibleMapping, JavaEclipseLinkConverterContainer.ParentAdapter { JavaEclipseLinkConverterContainer getConverterContainer(); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java index 4b6132289e..7a78c609fd 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -45,7 +45,24 @@ public interface JavaEclipseLinkConverterContainer ListIterable<JavaEclipseLinkTypeConverter> getTypeConverters(); JavaEclipseLinkTypeConverter addTypeConverter(int index); - interface Owner { + /** + * Parent adapter + */ + interface ParentAdapter { + /** + * Return the container's parent. + */ + JavaJpaContextNode getConverterContainerParent(); + + /** + * Return the element that is annotated with converters. + */ JavaResourceAnnotatedElement getJavaResourceAnnotatedElement(); + + /** + * Return whether the container's parent supports converters. + * (Virtual attributes do not support converters.) + */ + boolean parentSupportsConverters(); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java index bfb4911154..1795808f8b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Oracle. All rights reserved. + * Copyright (c) 2011, 2012 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. @@ -26,6 +26,7 @@ import org.eclipse.jpt.jpa.core.context.java.JavaColumn; import org.eclipse.jpt.jpa.core.context.java.JavaColumnMapping; import org.eclipse.jpt.jpa.core.context.java.JavaConverter; import org.eclipse.jpt.jpa.core.context.java.JavaEnumeratedConverter; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaLobConverter; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaTemporalConverter; @@ -222,13 +223,22 @@ public class JavaEclipseLinkArrayMapping2_3 } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** metamodel ********** @Override diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java index 4557d036fe..9843285d6b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -10,6 +10,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping; import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField; @@ -54,13 +55,22 @@ public class JavaEclipseLinkBasicCollectionMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** metamodel ********** @Override diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java index db6e07f1de..2f303a45bf 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -11,6 +11,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import java.util.ArrayList; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping; import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField; @@ -56,13 +57,22 @@ public class JavaEclipseLinkBasicMapMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** misc ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java index c6ac7d5091..131a82acea 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -14,6 +14,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.java.JavaConverter; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping; @@ -70,13 +71,22 @@ public class JavaEclipseLinkBasicMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** converter adapters ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java index 69726e6cd7..48f7bce159 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.resource.java.NestableAnnotation; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; +import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable; import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper; import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; @@ -36,7 +37,7 @@ public class JavaEclipseLinkConverterContainerImpl extends AbstractJavaJpaContextNode implements JavaEclipseLinkConverterContainer { - protected final Owner owner; + protected final ParentAdapter parentAdapter; protected final ContextListContainer<JavaEclipseLinkCustomConverter, EclipseLinkConverterAnnotation> customConverterContainer; protected final ContextListContainer<JavaEclipseLinkObjectTypeConverter, EclipseLinkObjectTypeConverterAnnotation> objectTypeConverterContainer; @@ -44,9 +45,9 @@ public class JavaEclipseLinkConverterContainerImpl protected final ContextListContainer<JavaEclipseLinkTypeConverter, EclipseLinkTypeConverterAnnotation> typeConverterContainer; - public JavaEclipseLinkConverterContainerImpl(JavaJpaContextNode parent, Owner owner) { - super(parent); - this.owner = owner; + public JavaEclipseLinkConverterContainerImpl(ParentAdapter parentAdapter) { + super(parentAdapter.getConverterContainerParent()); + this.parentAdapter = parentAdapter; this.customConverterContainer = this.buildCustomConverterContainer(); this.objectTypeConverterContainer = this.buildObjectTypeConverterContainer(); this.structConverterContainer = this.buildStructConverterContainer(); @@ -121,7 +122,9 @@ public class JavaEclipseLinkConverterContainerImpl } protected ListIterable<EclipseLinkConverterAnnotation> getCustomConverterAnnotations() { - return new SubListIterableWrapper<NestableAnnotation, EclipseLinkConverterAnnotation>(this.getNestableCustomConverterAnnotations_()); + return this.parentAdapter.parentSupportsConverters() ? + new SubListIterableWrapper<NestableAnnotation, EclipseLinkConverterAnnotation>(this.getNestableCustomConverterAnnotations_()) : + EmptyListIterable.<EclipseLinkConverterAnnotation>instance(); } protected ListIterable<NestableAnnotation> getNestableCustomConverterAnnotations_() { @@ -204,7 +207,9 @@ public class JavaEclipseLinkConverterContainerImpl } protected ListIterable<EclipseLinkObjectTypeConverterAnnotation> getObjectTypeConverterAnnotations() { - return new SubListIterableWrapper<NestableAnnotation, EclipseLinkObjectTypeConverterAnnotation>(this.getNestableObjectTypeConverterAnnotations_()); + return this.parentAdapter.parentSupportsConverters() ? + new SubListIterableWrapper<NestableAnnotation, EclipseLinkObjectTypeConverterAnnotation>(this.getNestableObjectTypeConverterAnnotations_()) : + EmptyListIterable.<EclipseLinkObjectTypeConverterAnnotation>instance(); } protected ListIterable<NestableAnnotation> getNestableObjectTypeConverterAnnotations_() { @@ -287,7 +292,9 @@ public class JavaEclipseLinkConverterContainerImpl } protected ListIterable<EclipseLinkStructConverterAnnotation> getStructConverterAnnotations() { - return new SubListIterableWrapper<NestableAnnotation, EclipseLinkStructConverterAnnotation>(this.getNestableStructConverterAnnotations_()); + return this.parentAdapter.parentSupportsConverters() ? + new SubListIterableWrapper<NestableAnnotation, EclipseLinkStructConverterAnnotation>(this.getNestableStructConverterAnnotations_()) : + EmptyListIterable.<EclipseLinkStructConverterAnnotation>instance(); } protected ListIterable<NestableAnnotation> getNestableStructConverterAnnotations_() { @@ -371,7 +378,9 @@ public class JavaEclipseLinkConverterContainerImpl } protected ListIterable<EclipseLinkTypeConverterAnnotation> getTypeConverterAnnotations() { - return new SubListIterableWrapper<NestableAnnotation, EclipseLinkTypeConverterAnnotation>(this.getNestableTypeConverterAnnotations_()); + return this.parentAdapter.parentSupportsConverters() ? + new SubListIterableWrapper<NestableAnnotation, EclipseLinkTypeConverterAnnotation>(this.getNestableTypeConverterAnnotations_()) : + EmptyListIterable.<EclipseLinkTypeConverterAnnotation>instance(); } protected ListIterable<NestableAnnotation> getNestableTypeConverterAnnotations_() { @@ -416,12 +425,12 @@ public class JavaEclipseLinkConverterContainerImpl return (JavaJpaContextNode) super.getParent(); } - protected Owner getOwner() { - return this.owner; + protected ParentAdapter getParentAdapter() { + return this.parentAdapter; } protected JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { - return this.getOwner().getJavaResourceAnnotatedElement(); + return this.getParentAdapter().getJavaResourceAnnotatedElement(); } @SuppressWarnings("unchecked") diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java index 35b0562ad8..f2ba879a37 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Oracle. All rights reserved. + * Copyright (c) 2010, 2012 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. @@ -14,6 +14,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.java.JavaConverter; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.AbstractJavaElementCollectionMapping2_0; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0; @@ -69,13 +70,22 @@ public class JavaEclipseLinkElementCollectionMapping2_0 } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** converter adapters ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java index e4c99a2792..aa64876362 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -17,6 +17,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable; import org.eclipse.jpt.jpa.core.context.AttributeMapping; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.internal.context.JptValidator; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddable; @@ -36,7 +37,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; */ public class JavaEclipseLinkEmbeddableImpl extends AbstractJavaEmbeddable - implements JavaEclipseLinkEmbeddable, JavaEclipseLinkConverterContainer.Owner + implements JavaEclipseLinkEmbeddable, JavaEclipseLinkConverterContainer.ParentAdapter { protected final JavaEclipseLinkConverterContainer converterContainer; @@ -79,7 +80,7 @@ public class JavaEclipseLinkEmbeddableImpl } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); } @SuppressWarnings("unchecked") @@ -138,10 +139,19 @@ public class JavaEclipseLinkEmbeddableImpl return false; } + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter + } + public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getJavaResourceType(); } + public boolean parentSupportsConverters() { + return true; + } // ********** validation ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java index 6dac0811c7..e10d1b5823 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Oracle. All rights reserved. + * Copyright (c) 2011, 2012 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. @@ -10,6 +10,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddedIdMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping; @@ -53,11 +54,21 @@ public class JavaEclipseLinkEmbeddedIdMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java index 2fb4e50da3..017f7c0f92 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Oracle. All rights reserved. + * Copyright (c) 2011, 2012 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. @@ -10,6 +10,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddedMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping; @@ -50,10 +51,20 @@ public class JavaEclipseLinkEmbeddedMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java index be3a346da1..bf03953941 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -19,6 +19,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable; import org.eclipse.jpt.jpa.core.context.AttributeMapping; import org.eclipse.jpt.jpa.core.context.InheritanceType; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.internal.context.JptValidator; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEntity; @@ -47,7 +48,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; */ public class JavaEclipseLinkEntityImpl extends AbstractJavaEntity - implements JavaEclipseLinkEntity, JavaEclipseLinkConverterContainer.Owner + implements JavaEclipseLinkEntity, JavaEclipseLinkConverterContainer.ParentAdapter { protected final JavaEclipseLinkCaching caching; @@ -126,7 +127,7 @@ public class JavaEclipseLinkEntityImpl } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); } @SuppressWarnings("unchecked") @@ -234,10 +235,20 @@ public class JavaEclipseLinkEntityImpl return ((JavaCacheableHolder2_0) this.getCaching()).calculateDefaultCacheable(); } + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter + } + public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getJavaResourceType(); } + public boolean parentSupportsConverters() { + return true; + } + // ********** Java completion proposals ********** @Override diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java index df5a7c98fc..584749bc0d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -14,6 +14,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.java.JavaConverter; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaIdMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping; @@ -70,13 +71,22 @@ public class JavaEclipseLinkIdMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** converter adapters ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java index 225b7ea034..b169bd9e87 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,6 +12,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaManyToManyMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch; @@ -68,12 +69,22 @@ public class JavaEclipseLinkManyToManyMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** validation ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java index 26e59833d3..2c1a52650a 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,6 +12,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaManyToOneMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch; @@ -68,13 +69,22 @@ public class JavaEclipseLinkManyToOneMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** validation ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java index c92bdbf98d..d35595468c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -18,6 +18,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable; import org.eclipse.jpt.jpa.core.context.AttributeMapping; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.internal.context.JptValidator; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaMappedSuperclass; @@ -46,7 +47,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; */ public class JavaEclipseLinkMappedSuperclassImpl extends AbstractJavaMappedSuperclass - implements JavaEclipseLinkMappedSuperclass, JavaCacheableHolder2_0, JavaEclipseLinkConverterContainer.Owner + implements JavaEclipseLinkMappedSuperclass, JavaCacheableHolder2_0, JavaEclipseLinkConverterContainer.ParentAdapter { protected final JavaEclipseLinkCaching caching; @@ -125,7 +126,7 @@ public class JavaEclipseLinkMappedSuperclassImpl } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); } @SuppressWarnings("unchecked") @@ -213,10 +214,19 @@ public class JavaEclipseLinkMappedSuperclassImpl return ((CacheableHolder2_0) this.getCaching()).calculateDefaultCacheable(); } + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter + } + public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getJavaResourceType(); } + public boolean parentSupportsConverters() { + return true; + } // ********** Java completion proposals ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java index a088d8420b..8dfc2c5ea7 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,6 +12,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaMappingRelationship; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaOneToManyMapping; @@ -83,13 +84,22 @@ public class JavaEclipseLinkOneToManyMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** relationship ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java index 5c36c0d829..ae6866d9d2 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,6 +12,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaOneToOneMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch; @@ -80,13 +81,22 @@ public class JavaEclipseLinkOneToOneMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** validation ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java index ca34c82e71..b6ea98a647 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -10,6 +10,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; @@ -53,13 +54,22 @@ public class JavaEclipseLinkTransformationMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** misc ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java index 0304dc80e3..4aca27cee5 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 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. @@ -10,6 +10,7 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; @@ -53,13 +54,22 @@ public class JavaEclipseLinkVariableOneToOneMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** misc ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java index e9b49a09f0..92b1f9bfcf 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.utility.internal.ArrayTools; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.java.JavaConverter; +import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaVersionMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable; @@ -73,13 +74,22 @@ public class JavaEclipseLinkVersionMapping } protected JavaEclipseLinkConverterContainer buildConverterContainer() { - return new JavaEclipseLinkConverterContainerImpl(this, this); + return new JavaEclipseLinkConverterContainerImpl(this); + } + + // ********** converter container parent adapter ********** + + public JavaJpaContextNode getConverterContainerParent() { + return this; // no adapter } public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() { return this.getResourceAttribute(); } + public boolean parentSupportsConverters() { + return ! this.getPersistentAttribute().isVirtual(); + } // ********** converter adapters ********** |