Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorkmoore2008-08-27 19:16:41 +0000
committerkmoore2008-08-27 19:16:41 +0000
commitdefff68a0979ac031b2296508541d16dac4ecfed (patch)
treefdeb1c8278a8526821c7a126078e0c60bc475698 /jpa
parent5786ce147ab2096243f26c878d5ac95b242a9bcb (diff)
downloadwebtools.dali-defff68a0979ac031b2296508541d16dac4ecfed.tar.gz
webtools.dali-defff68a0979ac031b2296508541d16dac4ecfed.tar.xz
webtools.dali-defff68a0979ac031b2296508541d16dac4ecfed.zip
bug 239137 - adding caching support to EclispeLinkMappedSuperclass
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFactory.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactoryImpl.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties4
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactoryImpl.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/EclipseLinkMappedSuperclassComposite.java79
9 files changed, 238 insertions, 4 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFactory.java
index 575ed1acad..ee231b56d8 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaFactory.java
@@ -14,6 +14,7 @@ import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.java.JavaTypeMapping;
import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaCaching;
import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
+import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass;
/**
* Use EclipseLinkJpaFactory to create any EclispeLink specific
@@ -29,9 +30,14 @@ import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
* @since 2.1
*/
public interface EclipseLinkJpaFactory extends JpaFactory
-{
-
+{
+ EclipseLinkJavaCaching buildEclipseLinkJavaCaching(JavaTypeMapping parent);
+
+
+ //********* covariant overrides ***********
+
EclipseLinkJavaEntity buildJavaEntity(JavaPersistentType parent);
- EclipseLinkJavaCaching buildEclipseLinkJavaCaching(JavaTypeMapping parent);
+ EclipseLinkJavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent);
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java
new file mode 100644
index 0000000000..13987e8d1e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.context;
+
+import org.eclipse.jpt.core.context.MappedSuperclass;
+
+/**
+ *
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.1
+ * @since 2.1
+ */
+public interface EclipseLinkMappedSuperclass extends MappedSuperclass
+{
+ EclipseLinkCaching getCaching();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java
new file mode 100644
index 0000000000..6445310e7f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/EclipseLinkJavaMappedSuperclass.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.context.java;
+
+import java.util.Iterator;
+import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
+import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
+
+/**
+ *
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.1
+ * @since 2.1
+ */
+public interface EclipseLinkJavaMappedSuperclass extends EclipseLinkMappedSuperclass, JavaMappedSuperclass
+{
+ EclipseLinkJavaCaching getCaching();
+
+
+ //********* covariant overrides ***********
+
+ Iterator<JavaPersistentAttribute> overridableAttributes();
+ Iterator<JavaPersistentAttribute> overridableAssociations();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactoryImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactoryImpl.java
index 8212e2b8cb..d9d26075c9 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactoryImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactoryImpl.java
@@ -21,9 +21,11 @@ import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaFactory;
import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaCaching;
import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity;
+import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass;
import org.eclipse.jpt.eclipselink.core.internal.context.EclipseLinkPersistenceUnit;
import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaCachingImpl;
import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaEntityImpl;
+import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassImpl;
import org.eclipse.jpt.eclipselink.core.resource.elorm.EclipseLinkOrmResourceModel;
public class EclipseLinkJpaFactoryImpl extends GenericJpaFactory implements EclipseLinkJpaFactory
@@ -42,6 +44,11 @@ public class EclipseLinkJpaFactoryImpl extends GenericJpaFactory implements Ecli
return new EclipseLinkJavaEntityImpl(parent);
}
+ @Override
+ public EclipseLinkJavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent) {
+ return new EclipseLinkJavaMappedSuperclassImpl(parent);
+ }
+
public EclipseLinkJavaCaching buildEclipseLinkJavaCaching(JavaTypeMapping parent) {
return new EclipseLinkJavaCachingImpl(parent);
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
new file mode 100644
index 0000000000..f745d99f86
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.context.java;
+
+import java.util.List;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.core.internal.context.java.GenericJavaMappedSuperclass;
+import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
+import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaFactory;
+import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaCaching;
+import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+
+public class EclipseLinkJavaMappedSuperclassImpl extends GenericJavaMappedSuperclass implements EclipseLinkJavaMappedSuperclass
+{
+ protected EclipseLinkJavaCaching eclipseLinkCaching;
+
+ public EclipseLinkJavaMappedSuperclassImpl(JavaPersistentType parent) {
+ super(parent);
+ this.eclipseLinkCaching = getJpaFactory().buildEclipseLinkJavaCaching(this);
+ }
+
+
+ public EclipseLinkJavaCaching getCaching() {
+ return this.eclipseLinkCaching;
+ }
+
+ @Override
+ protected EclipseLinkJpaFactory getJpaFactory() {
+ return (EclipseLinkJpaFactory) super.getJpaFactory();
+ }
+
+
+ @Override
+ public void update(JavaResourcePersistentType resourcePersistentType) {
+ super.update(resourcePersistentType);
+ this.eclipseLinkCaching.update(resourcePersistentType);
+ }
+
+ @Override
+ public void initialize(JavaResourcePersistentType resourcePersistentType) {
+ super.initialize(resourcePersistentType);
+ this.eclipseLinkCaching.initialize(resourcePersistentType);
+ }
+
+ //********** Validation ********************************************
+
+ @Override
+ public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
+ super.addToMessages(messages, astRoot);
+ getCaching().addToMessages(messages, astRoot);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties
index f3ec258dd5..ba43752de9 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties
@@ -50,4 +50,6 @@ ExpiryComposite_timeToLiveExpiry = Time to live expiry
ExpiryComposite_timeToLiveExpiryExpireAfter = Expire after
ExpiryComposite_timeToLiveExpiryMilliseconds = milliseconds
ExpiryComposite_dailyExpiry = Daily expiry
-ExpiryComposite_timeOfDayExpiryExpireAt = Expire at \ No newline at end of file
+ExpiryComposite_timeOfDayExpiryExpireAt = Expire at
+
+EclipseLinkMappedSuperclassComposite_caching = Caching \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactoryImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactoryImpl.java
index ee35381ba1..cb8fed6536 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactoryImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactoryImpl.java
@@ -11,6 +11,7 @@ package org.eclipse.jpt.eclipselink.ui.internal;
import java.util.ArrayList;
import java.util.ListIterator;
+import org.eclipse.jpt.core.context.MappedSuperclass;
import org.eclipse.jpt.core.context.java.JavaEntity;
import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.eclipselink.core.internal.context.EclipseLinkPersistenceUnit;
@@ -26,6 +27,7 @@ import org.eclipse.jpt.eclipselink.ui.internal.connection.PersistenceXmlConnecti
import org.eclipse.jpt.eclipselink.ui.internal.customization.PersistenceXmlCustomizationTab;
import org.eclipse.jpt.eclipselink.ui.internal.java.details.EclipseLinkJavaEntityComposite;
import org.eclipse.jpt.eclipselink.ui.internal.logging.PersistenceXmlLoggingTab;
+import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkMappedSuperclassComposite;
import org.eclipse.jpt.eclipselink.ui.internal.options.PersistenceXmlOptionsTab;
import org.eclipse.jpt.eclipselink.ui.internal.schema.generation.PersistenceXmlSchemaGenerationTab;
import org.eclipse.jpt.ui.WidgetFactory;
@@ -57,6 +59,15 @@ public class EclipseLinkJpaUiFactoryImpl extends BaseJpaUiFactory implements Ecl
}
@Override
+ public JpaComposite createMappedSuperclassComposite(
+ PropertyValueModel<MappedSuperclass> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+
+ return new EclipseLinkMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
+ }
+
+ @Override
public ListIterator<JpaPageComposite> createPersistenceUnitComposites(
PropertyValueModel<PersistenceUnit> subjectHolder,
Composite parent,
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java
index e9fbc96df5..1f2669f533 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java
@@ -29,6 +29,7 @@ public class EclipseLinkUiMappingsMessages extends NLS {
public static String CacheTypeComposite_cache;
public static String CacheTypeComposite_none;
public static String EclipseLinkJavaEntityComposite_caching;
+ public static String EclipseLinkMappedSuperclassComposite_caching;
public static String CacheSizeComposite_size;
public static String CacheCoordinationTypeComposite_label;
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/EclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/EclipseLinkMappedSuperclassComposite.java
new file mode 100644
index 0000000000..e33feec23f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/EclipseLinkMappedSuperclassComposite.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.ui.internal.mappings.details;
+
+import org.eclipse.jpt.core.context.MappedSuperclass;
+import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
+import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
+import org.eclipse.jpt.eclipselink.ui.internal.mappings.EclipseLinkUiMappingsMessages;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.internal.mappings.details.IdClassComposite;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * The pane used for an EclipseLink Java entity.
+ *
+ * @see EclipseLinkMappedSuperclass
+ * @see EclipselinkJpaUiFactory - The factory creating this pane
+ *
+ * @version 2.0
+ * @since 1.0
+ */
+public class EclipseLinkMappedSuperclassComposite extends FormPane<MappedSuperclass>
+ implements JpaComposite
+{
+ /**
+ * Creates a new <code>MappedSuperclassComposite</code>.
+ *
+ * @param subjectHolder The holder of this pane's subject
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create various common widgets
+ */
+ public EclipseLinkMappedSuperclassComposite(PropertyValueModel<MappedSuperclass> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+
+ super(subjectHolder, parent, widgetFactory);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ // Primary Key Class widgets
+ new IdClassComposite(this, container);
+ initializeCachingPane(container);
+ }
+
+
+ protected void initializeCachingPane(Composite container) {
+
+ container = addCollapsableSection(
+ addSubPane(container, 5),
+ EclipseLinkUiMappingsMessages.EclipseLinkMappedSuperclassComposite_caching
+ );
+
+ new CachingComposite(this, buildCachingHolder(), container);
+ }
+
+ private PropertyAspectAdapter<MappedSuperclass, EclipseLinkCaching> buildCachingHolder() {
+ return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkCaching>(
+ getSubjectHolder())
+ {
+ @Override
+ protected EclipseLinkCaching buildValue_() {
+ return ((EclipseLinkMappedSuperclass) this.subject).getCaching();
+ }
+ };
+ }
+} \ No newline at end of file

Back to the top