Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2009-11-30 16:26:16 -0500
committerkmoore2009-11-30 16:26:16 -0500
commit9ac6c0c203d67f0379580a0e1f9ea47b136a9df1 (patch)
tree08e3e6159f0d480582d3c4bc390c789796a9392f
parenteb863b66a85f27cd6086df30daf670e8e9ef905c (diff)
downloadwebtools.dali-9ac6c0c203d67f0379580a0e1f9ea47b136a9df1.tar.gz
webtools.dali-9ac6c0c203d67f0379580a0e1f9ea47b136a9df1.tar.xz
webtools.dali-9ac6c0c203d67f0379580a0e1f9ea47b136a9df1.zip
258515 - OrderColumn support in both orm and java
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java333
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java261
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractManyToManyMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractOrderingComposite.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/OrderingComposite.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java174
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java60
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java66
68 files changed, 2625 insertions, 643 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
index 465d64738e..6105576a9b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
@@ -52,6 +52,7 @@ import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
import org.eclipse.jpt.core.context.java.JavaNamedQuery;
import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
+import org.eclipse.jpt.core.context.java.JavaOrderable;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
@@ -219,6 +220,8 @@ public interface JpaFactory
JavaConverter buildJavaNullConverter(JavaAttributeMapping parent);
+ JavaOrderable buildJavaOrderable(JavaAttributeMapping parent);
+
AssociationOverrideAnnotation buildJavaVirtualAssociationOverrideAnnotation(JavaResourcePersistentMember jrpm, String name, JoiningStrategy joiningStrategy);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
index d30e9e22ab..8951694012 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
@@ -25,24 +25,7 @@ public interface MultiRelationshipMapping
{
FetchType DEFAULT_FETCH_TYPE = FetchType.LAZY;
- String getOrderBy();
-
- String getSpecifiedOrderBy();
- void setSpecifiedOrderBy(String orderBy);
- String SPECIFIED_ORDER_BY_PROPERTY = "specifiedOrderBy"; //$NON-NLS-1$
-
- boolean isNoOrdering();
- void setNoOrdering(boolean noOrdering);
- String NO_ORDERING_PROPERTY = "noOrdering"; //$NON-NLS-1$
-
- boolean isPkOrdering();
- void setPkOrdering(boolean pkOrdering);
- String PK_ORDERING_PROPERTY = "pkOrdering"; //$NON-NLS-1$
-
- boolean isCustomOrdering();
- void setCustomOrdering(boolean customOrdering);
- String CUSTOM_ORDERING_PROPERTY = "customOrdering"; //$NON-NLS-1$
-
+ Orderable getOrderable();
String getMapKey();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java
new file mode 100644
index 0000000000..bcda6e9969
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 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.context;
+
+/**
+ * Multi-valued (1:m, m:m) relationship mappings support ordering.
+ * <p>
+ * 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.
+ */
+public interface Orderable
+ extends JpaContextNode
+{
+
+ String getSpecifiedOrderBy();
+ void setSpecifiedOrderBy(String orderBy);
+ String SPECIFIED_ORDER_BY_PROPERTY = "specifiedOrderBy"; //$NON-NLS-1$
+
+ boolean isNoOrdering();
+ void setNoOrdering(boolean noOrdering);
+ String NO_ORDERING_PROPERTY = "noOrdering"; //$NON-NLS-1$
+
+ boolean isPkOrdering();
+ void setPkOrdering(boolean pkOrdering);
+ String PK_ORDERING_PROPERTY = "pkOrdering"; //$NON-NLS-1$
+
+ boolean isCustomOrdering();
+ void setCustomOrdering(boolean customOrdering);
+ String CUSTOM_ORDERING_PROPERTY = "customOrdering"; //$NON-NLS-1$
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java
new file mode 100644
index 0000000000..da50bc56ae
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.context.java;
+
+import org.eclipse.jpt.core.context.Orderable;
+
+/**
+ *
+ *
+ * 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.
+ */
+public interface JavaOrderable
+ extends Orderable, JavaJpaContextNode
+{
+
+ void initialize();
+
+ void update();
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
index 336feedc63..9b0edb56a0 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
@@ -10,6 +10,7 @@
package org.eclipse.jpt.core.context.orm;
import org.eclipse.jpt.core.context.MultiRelationshipMapping;
+import org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping;
/**
* ORM multi-valued (1:m, m:m) relationship mapping.
@@ -23,5 +24,8 @@ import org.eclipse.jpt.core.context.MultiRelationshipMapping;
public interface OrmMultiRelationshipMapping
extends OrmRelationshipMapping, MultiRelationshipMapping
{
+ AbstractXmlMultiRelationshipMapping getResourceAttributeMapping();
+
+
// nothing yet
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java
new file mode 100644
index 0000000000..9cdcd8a74f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.context.orm;
+
+import org.eclipse.jpt.core.context.Orderable;
+import org.eclipse.jpt.core.context.XmlContextNode;
+
+/**
+ *
+ *
+ * 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.
+ */
+public interface OrmOrderable extends Orderable, XmlContextNode
+{
+ void update();
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
index c7b25a4ff9..9e853469c7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
@@ -164,6 +164,7 @@ public interface OrmXmlContextNodeFactory extends XmlContextNodeFactory
OrmConverter buildOrmNullConverter(OrmAttributeMapping parent);
+ OrmOrderable buildOrmOrderable(OrmAttributeMapping parent);
// ********** ORM Virtual Resource Model **********
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java
index 10dce416bf..452979a45d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java
@@ -51,10 +51,12 @@ import org.eclipse.jpt.core.context.java.JavaLobConverter;
import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
+import org.eclipse.jpt.core.context.java.JavaNamedColumn;
import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
import org.eclipse.jpt.core.context.java.JavaNamedQuery;
import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
+import org.eclipse.jpt.core.context.java.JavaOrderable;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.context.java.JavaPersistentType;
import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
@@ -105,6 +107,7 @@ import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaNullAttributeM
import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaNullConverter;
import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOneToManyMapping;
import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOneToOneMapping;
+import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOrderable;
import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPersistentAttribute;
import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPersistentType;
import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPrimaryKeyJoinColumn;
@@ -122,6 +125,7 @@ import org.eclipse.jpt.core.internal.jpa1.context.java.NullJavaAssociationOverri
import org.eclipse.jpt.core.internal.jpa1.context.java.VirtualAssociationOverride1_0Annotation;
import org.eclipse.jpt.core.internal.jpa2.NullMetamodelSynchronizer;
import org.eclipse.jpt.core.internal.jpa2.NullPersistentTypeMetamodelSynchronizer;
+import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOrderColumn2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaCacheable2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaDerivedId2_0;
import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaMapsId2_0;
@@ -136,6 +140,8 @@ import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedId2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaMapsId2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_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.context.java.JavaSingleRelationshipMapping2_0;
@@ -370,6 +376,10 @@ public abstract class AbstractJpaFactory
return new GenericJavaNullConverter(parent);
}
+ public JavaOrderable buildJavaOrderable(JavaAttributeMapping parent) {
+ return new GenericJavaOrderable(parent);
+ }
+
public JavaDerivedId2_0 buildJavaDerivedId(JavaSingleRelationshipMapping2_0 parent) {
return new NullJavaDerivedId2_0(parent);
}
@@ -389,4 +399,9 @@ public abstract class AbstractJpaFactory
public JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent) {
return new NullJavaOrphanRemoval2_0(parent);
}
+
+ public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner) {
+ return new GenericJavaOrderColumn2_0(parent, owner);
+ }
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
index b32ba33c35..438aa8caa9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
@@ -13,14 +13,17 @@ import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.JptCorePlugin;
import org.eclipse.jpt.core.context.FetchType;
+import org.eclipse.jpt.core.context.Orderable;
import org.eclipse.jpt.core.context.java.JavaMultiRelationshipMapping;
+import org.eclipse.jpt.core.context.java.JavaOrderable;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_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.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
import org.eclipse.jpt.utility.Filter;
import org.eclipse.jpt.utility.internal.ArrayTools;
@@ -34,6 +37,8 @@ public abstract class AbstractJavaMultiRelationshipMapping<T extends Relationshi
extends AbstractJavaRelationshipMapping<T>
implements JavaMultiRelationshipMapping
{
+ protected final JavaOrderable orderable;
+
protected String specifiedOrderBy = null;
protected boolean noOrdering = false;
protected boolean pkOrdering = false;
@@ -47,19 +52,20 @@ public abstract class AbstractJavaMultiRelationshipMapping<T extends Relationshi
protected AbstractJavaMultiRelationshipMapping(JavaPersistentAttribute parent) {
super(parent);
+ this.orderable = getJpaFactory().buildJavaOrderable(this);
}
@Override
protected void initialize() {
super.initialize();
- this.initializeOrderBy();
+ this.orderable.initialize();
this.initializeMapKey();
}
@Override
protected void update() {
super.update();
- this.updateOrderBy();
+ this.orderable.update();
this.updateMapKey();
}
@@ -67,12 +73,19 @@ public abstract class AbstractJavaMultiRelationshipMapping<T extends Relationshi
@Override
protected String[] buildSupportingAnnotationNames() {
- return ArrayTools.addAll(
+ String[] annotationNames = ArrayTools.addAll(
super.buildSupportingAnnotationNames(),
JPA.JOIN_TABLE,
JPA.MAP_KEY,
- JPA.ORDER_BY
- );
+ JPA.ORDER_BY);
+
+ if (getJpaPlatformVersion().isCompatibleWithJpaVersion(JptCorePlugin.JPA_FACET_VERSION_2_0)) {
+ annotationNames = ArrayTools.addAll(
+ annotationNames,
+ JPA2_0.ORDER_COLUMN);
+ }
+
+ return annotationNames;
}
// ********** AbstractJavaRelationshipMapping implementation **********
@@ -83,173 +96,10 @@ public abstract class AbstractJavaMultiRelationshipMapping<T extends Relationshi
}
- // ********** order by **********
-
- public String getOrderBy() {
- if (this.noOrdering) {
- return null;
- }
- if (this.pkOrdering) {
- return this.getTargetEntityIdAttributeName();
- }
- if (this.customOrdering) {
- return this.specifiedOrderBy;
- }
- throw new IllegalStateException("unknown ordering"); //$NON-NLS-1$
- }
-
- public String getSpecifiedOrderBy() {
- return this.specifiedOrderBy;
- }
-
- public void setSpecifiedOrderBy(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- if (orderBy == null) {
- if (orderByAnnotation != null) {
- this.removeOrderByAnnotation();
- }
- } else {
- if (orderByAnnotation == null) {
- orderByAnnotation = this.addOrderByAnnotation();
- }
- orderByAnnotation.setValue(orderBy);
- }
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void setSpecifiedOrderBy_(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void initializeOrderBy() {
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- if (orderByAnnotation == null) {
- this.noOrdering = true;
- } else {
- this.specifiedOrderBy = orderByAnnotation.getValue();
- if (this.specifiedOrderBy == null) {
- this.pkOrdering = true;
- } else {
- this.customOrdering = true;
- }
- }
- }
-
- protected void updateOrderBy() {
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- if (orderByAnnotation == null) {
- this.setSpecifiedOrderBy_(null);
- this.setNoOrdering_(true);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(false);
- } else {
- String ob = orderByAnnotation.getValue();
- this.setSpecifiedOrderBy_(ob);
- this.setNoOrdering_(false);
- this.setPkOrdering_(ob == null);
- this.setCustomOrdering_(ob != null);
- }
- }
-
- protected OrderByAnnotation getOrderByAnnotation() {
- return (OrderByAnnotation) this.getResourcePersistentAttribute().getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- protected OrderByAnnotation addOrderByAnnotation() {
- return (OrderByAnnotation) this.getResourcePersistentAttribute().addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeOrderByAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** no ordering **********
-
- public boolean isNoOrdering() {
- return this.noOrdering;
- }
-
- public void setNoOrdering(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- if (noOrdering) {
- if (this.getOrderByAnnotation() != null) {
- this.removeOrderByAnnotation();
- }
- } else {
- // the 'noOrdering' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setNoOrdering_(boolean)
- }
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
- protected void setNoOrdering_(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
-
- // ********** pk ordering **********
-
- public boolean isPkOrdering() {
- return this.pkOrdering;
- }
-
- public void setPkOrdering(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- if (pkOrdering) {
- if (orderByAnnotation == null) {
- this.addOrderByAnnotation();
- } else {
- orderByAnnotation.setValue(null);
- }
- } else {
- // the 'pkOrdering' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setPkOrdering_(boolean)
- }
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
- protected void setPkOrdering_(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
-
- // ********** custom ordering **********
-
- public boolean isCustomOrdering() {
- return this.customOrdering;
- }
-
- public void setCustomOrdering(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- if (customOrdering) {
- this.setSpecifiedOrderBy(""); //$NON-NLS-1$
- } else {
- // the 'customOrdering' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setCustomOrdering_(boolean)
- }
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
- }
+ // ********** ordering **********
- protected void setCustomOrdering_(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
+ public Orderable getOrderable() {
+ return this.orderable;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
index 62fba6ee5b..de4f1b730a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
@@ -157,7 +157,9 @@ public abstract class AbstractJavaNamedColumn<T extends NamedColumnAnnotation> e
/**
* Return the name of the column's table.
*/
- protected abstract String getTableName();
+ protected String getTableName() {
+ return this.getOwner().getTypeMapping().getPrimaryTableName();
+ }
public boolean isResolved() {
return this.getDbColumn() != null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java
index f3759a1479..6a6e880986 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java
@@ -70,9 +70,7 @@ public abstract class AbstractOrmBaseColumn<T extends AbstractXmlColumn> extends
if (this.valuesAreDifferent(oldSpecifiedTable, newSpecifiedTable)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setTable(newSpecifiedTable);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedTable != null) {
addResourceColumn();
@@ -152,9 +150,7 @@ public abstract class AbstractOrmBaseColumn<T extends AbstractXmlColumn> extends
if (this.valuesAreDifferent(oldSpecifiedNullable, newSpecifiedNullable)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setNullable(newSpecifiedNullable);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedNullable != null) {
addResourceColumn();
@@ -188,9 +184,7 @@ public abstract class AbstractOrmBaseColumn<T extends AbstractXmlColumn> extends
if (this.valuesAreDifferent(oldSpecifiedInsertable, newSpecifiedInsertable)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setInsertable(newSpecifiedInsertable);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedInsertable != null) {
addResourceColumn();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
index e97434f4b8..75db97ac5c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
@@ -14,7 +14,9 @@ import java.util.Iterator;
import org.eclipse.jpt.core.context.FetchType;
import org.eclipse.jpt.core.context.MultiRelationshipMapping;
+import org.eclipse.jpt.core.context.Orderable;
import org.eclipse.jpt.core.context.orm.OrmMultiRelationshipMapping;
+import org.eclipse.jpt.core.context.orm.OrmOrderable;
import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
@@ -29,27 +31,23 @@ public abstract class AbstractOrmMultiRelationshipMapping<T extends AbstractXmlM
extends AbstractOrmRelationshipMapping<T>
implements OrmMultiRelationshipMapping
{
- protected String specifiedOrderBy;
- protected boolean noOrdering = false;
- protected boolean pkOrdering = false;
- protected boolean customOrdering = false;
-
+ protected final OrmOrderable orderable;
+
protected String specifiedMapKey;
protected boolean noMapKey = false;
protected boolean pkMapKey = false;
protected boolean customMapKey = false;
-
protected AbstractOrmMultiRelationshipMapping(OrmPersistentAttribute parent, T resourceMapping) {
super(parent, resourceMapping);
- this.initializeOrderBy();
+ this.orderable = getXmlContextNodeFactory().buildOrmOrderable(this);
this.initializeMapKey();
}
@Override
public void update() {
super.update();
- this.updateOrderBy();
+ this.orderable.update();
this.updateMapKey();
}
@@ -64,133 +62,9 @@ public abstract class AbstractOrmMultiRelationshipMapping<T extends AbstractXmlM
// **************** order by ***********************************************
-
- public String getOrderBy() {
- if (this.noOrdering) {
- return null;
- }
- if (this.pkOrdering) {
- return this.getTargetEntityIdAttributeName();
- }
- if (this.customOrdering) {
- return this.specifiedOrderBy;
- }
- throw new IllegalStateException("unknown ordering"); //$NON-NLS-1$
- }
-
- public String getSpecifiedOrderBy() {
- return this.specifiedOrderBy;
- }
-
- public void setSpecifiedOrderBy(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- this.resourceAttributeMapping.setOrderBy(orderBy);
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void setSpecifiedOrderBy_(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
- protected void initializeOrderBy() {
- this.specifiedOrderBy = this.getXmlOrderBy();
- if (this.specifiedOrderBy == null) {
- this.noOrdering = true;
- } else if (this.specifiedOrderBy.equals("")) { //$NON-NLS-1$
- this.pkOrdering = true;
- } else {
- this.customOrdering = true;
- }
- }
-
- protected void updateOrderBy() {
- this.setSpecifiedOrderBy_(this.getXmlOrderBy());
- if (this.specifiedOrderBy == null) {
- this.setNoOrdering_(true);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(false);
- } else if (this.specifiedOrderBy.equals("")) { //$NON-NLS-1$
- this.setNoOrdering_(false);
- this.setPkOrdering_(true);
- this.setCustomOrdering_(false);
- } else {
- this.setNoOrdering_(false);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(true);
- }
- }
-
- protected String getXmlOrderBy() {
- return this.resourceAttributeMapping.getOrderBy();
- }
-
-
- // **************** no ordering ***********************************************
-
- public boolean isNoOrdering() {
- return this.noOrdering;
- }
-
- public void setNoOrdering(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- if (noOrdering) {
- this.resourceAttributeMapping.setOrderBy(null);
- }
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
- protected void setNoOrdering_(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
-
- // **************** pk ordering ***********************************************
-
- public boolean isPkOrdering() {
- return this.pkOrdering;
- }
-
- public void setPkOrdering(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- if (pkOrdering) {
- this.resourceAttributeMapping.setOrderBy(""); //$NON-NLS-1$
- }
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
- protected void setPkOrdering_(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
-
- // **************** custom ordering ***********************************************
-
- public boolean isCustomOrdering() {
- return this.customOrdering;
- }
-
- public void setCustomOrdering(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- if (customOrdering) {
- this.setSpecifiedOrderBy(""); //$NON-NLS-1$
- }
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
- }
-
- protected void setCustomOrdering_(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
+ public Orderable getOrderable() {
+ return this.orderable;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
index e837621c99..3adc4a367c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
@@ -50,6 +50,12 @@ public abstract class AbstractOrmNamedColumn<T extends AbstractXmlNamedColumn> e
protected abstract void addResourceColumn();
+ protected void removeResourceColumnIfFeaturesUnset() {
+ if (this.getResourceColumn().isUnset()) {
+ removeResourceColumn();
+ }
+ }
+
public Owner getOwner() {
return this.owner;
}
@@ -67,10 +73,8 @@ public abstract class AbstractOrmNamedColumn<T extends AbstractXmlNamedColumn> e
this.specifiedName = newSpecifiedName;
if (this.attributeValueHasChanged(oldSpecifiedName, newSpecifiedName)) {
if (this.getResourceColumn() != null) {
- this.getResourceColumn().setName(newSpecifiedName);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.getResourceColumn().setName(newSpecifiedName);
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedName != null) {
addResourceColumn();
@@ -105,10 +109,8 @@ public abstract class AbstractOrmNamedColumn<T extends AbstractXmlNamedColumn> e
this.columnDefinition = newColumnDefinition;
if (this.attributeValueHasChanged(oldColumnDefinition, newColumnDefinition)) {
if (this.getResourceColumn() != null) {
- this.getResourceColumn().setColumnDefinition(newColumnDefinition);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.getResourceColumn().setColumnDefinition(newColumnDefinition);
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newColumnDefinition != null) {
addResourceColumn();
@@ -133,7 +135,9 @@ public abstract class AbstractOrmNamedColumn<T extends AbstractXmlNamedColumn> e
return getOwner().getDbTable(this.getOwningTableName());
}
- protected abstract String getOwningTableName();
+ protected String getOwningTableName() {
+ return this.getOwner().getTypeMapping().getPrimaryTableName();
+ }
public boolean isResolved() {
return getDbColumn() != null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
index 69a960cb7c..10e6b6046e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
@@ -51,10 +51,12 @@ import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
+import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
+import org.eclipse.jpt.core.context.orm.OrmOrderable;
import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
import org.eclipse.jpt.core.context.orm.OrmPersistentType;
@@ -104,6 +106,7 @@ import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNullAttributeMap
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNullConverter;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmOneToManyMapping;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmOneToOneMapping;
+import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmOrderable;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmPersistentAttribute;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmPersistentType;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmPrimaryKeyJoinColumn;
@@ -121,6 +124,7 @@ import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXml;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericPersistenceUnitDefaults;
import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericPersistenceUnitMetadata;
import org.eclipse.jpt.core.internal.jpa1.context.orm.UnsupportedOrmAttributeMapping;
+import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmOrderColumn2_0;
import org.eclipse.jpt.core.internal.jpa2.context.orm.NullOrmCacheable2_0;
import org.eclipse.jpt.core.internal.jpa2.context.orm.NullOrmDerivedId2_0;
import org.eclipse.jpt.core.internal.jpa2.context.orm.NullOrmMapsId2_0;
@@ -132,6 +136,8 @@ import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedId2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmMapsId2_0;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
@@ -373,6 +379,14 @@ public abstract class AbstractOrmXmlContextNodeFactory implements OrmXml2_0Conte
return new GenericOrmNullConverter(parent);
}
+ public OrmOrderable buildOrmOrderable(OrmAttributeMapping parent) {
+ return new GenericOrmOrderable(parent);
+ }
+
+ public OrmOrderColumn2_0 buildOrmOrderColumn(OrmOrderable2_0 parent, OrmNamedColumn.Owner owner) {
+ return new GenericOrmOrderColumn2_0(parent, owner);
+ }
+
public OrmDerivedId2_0 buildOrmDerivedId(
OrmSingleRelationshipMapping2_0 parent, XmlDerivedId_2_0 resource) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
index 2b7791f4a6..1d5ebe08a4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
@@ -12,12 +12,14 @@ package org.eclipse.jpt.core.internal.context.orm;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
+import org.eclipse.jpt.core.jpa2.context.Orderable2_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;
import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
/**
@@ -158,7 +160,7 @@ public class VirtualXmlManyToMany
if (this.isOrmMetadataComplete()) {
return null;
}
- return this.javaAttributeMapping.getSpecifiedOrderBy();
+ return this.javaAttributeMapping.getOrderable().getSpecifiedOrderBy();
}
@Override
@@ -167,6 +169,16 @@ public class VirtualXmlManyToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ if (((Orderable2_0) this.javaAttributeMapping.getOrderable()).isOrderColumnOrdering()) {
+ return new VirtualXmlOrderColumn(
+ ((Orderable2_0) this.javaAttributeMapping.getOrderable()).getOrderColumn(),
+ this.ormTypeMapping.isMetadataComplete());
+ }
+ return null;
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return null;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
index f9bd7a321f..2a97d19ae5 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
@@ -12,12 +12,14 @@ package org.eclipse.jpt.core.internal.context.orm;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
+import org.eclipse.jpt.core.jpa2.context.Orderable2_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;
import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
/**
@@ -171,7 +173,7 @@ public class VirtualXmlOneToMany
if (this.isOrmMetadataComplete()) {
return null;
}
- return this.javaAttributeMapping.getSpecifiedOrderBy();
+ return this.javaAttributeMapping.getOrderable().getSpecifiedOrderBy();
}
@Override
@@ -180,6 +182,16 @@ public class VirtualXmlOneToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ if (((Orderable2_0) this.javaAttributeMapping.getOrderable()).isOrderColumnOrdering()) {
+ return new VirtualXmlOrderColumn(
+ ((Orderable2_0) this.javaAttributeMapping.getOrderable()).getOrderColumn(),
+ this.ormTypeMapping.isMetadataComplete());
+ }
+ return null;
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return null;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java
new file mode 100644
index 0000000000..28081bc7d3
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * 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.context.orm;
+
+import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
+import org.eclipse.jpt.core.utility.TextRange;
+
+public class VirtualXmlOrderColumn extends XmlOrderColumn
+{
+ protected OrderColumn2_0 javaOrderColumn;
+
+ protected boolean metadataComplete;
+
+ public VirtualXmlOrderColumn(OrderColumn2_0 javaOrderColumn, boolean metadataComplete) {
+ super();
+ this.javaOrderColumn = javaOrderColumn;
+ this.metadataComplete = metadataComplete;
+ }
+
+ @Override
+ public String getColumnDefinition() {
+ if (this.metadataComplete) {
+ return null;
+ }
+ return this.javaOrderColumn.getColumnDefinition();
+ }
+
+ @Override
+ public void setColumnDefinition(String value) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
+ @Override
+ public Boolean getInsertable() {
+ if (this.metadataComplete) {
+ return Boolean.valueOf(this.javaOrderColumn.isDefaultInsertable());
+ }
+ return Boolean.valueOf(this.javaOrderColumn.isInsertable());
+ }
+
+ @Override
+ public void setInsertable(Boolean value) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ if (this.metadataComplete) {
+ return this.javaOrderColumn.getDefaultName();
+ }
+ return this.javaOrderColumn.getName();
+ }
+
+ @Override
+ public void setName(String value) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
+
+ @Override
+ public Boolean getNullable() {
+ if (this.metadataComplete) {
+ return Boolean.valueOf(this.javaOrderColumn.isDefaultNullable());
+ }
+ return Boolean.valueOf(this.javaOrderColumn.isNullable());
+ }
+
+ @Override
+ public void setNullable(Boolean value) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
+ @Override
+ public Boolean getUpdatable() {
+ if (this.metadataComplete) {
+ return Boolean.valueOf(this.javaOrderColumn.isDefaultUpdatable());
+ }
+ return Boolean.valueOf(this.javaOrderColumn.isUpdatable());
+ }
+
+ @Override
+ public void setUpdatable(Boolean value) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
+
+ @Override
+ public TextRange getNameTextRange() {
+ return null;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java
index b82342c7ef..389e9cd197 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java
@@ -53,10 +53,6 @@ public class GenericJavaDiscriminatorColumn extends AbstractJavaNamedColumn<Disc
return (JavaDiscriminatorColumn.Owner) super.getOwner();
}
- protected JavaEntity getJavaEntity() {
- return (JavaEntity) super.getParent();
- }
-
public boolean isResourceSpecified() {
return getResourceColumn().isSpecified();
}
@@ -134,11 +130,6 @@ public class GenericJavaDiscriminatorColumn extends AbstractJavaNamedColumn<Disc
this.specifiedLength = newSpecifiedLength;
firePropertyChanged(DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
}
-
- @Override
- protected String getTableName() {
- return getJavaEntity().getPrimaryTableName();
- }
public TextRange getValidationTextRange(CompilationUnit astRoot) {
TextRange textRange = getResourceColumn().getTextRange(astRoot);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java
new file mode 100644
index 0000000000..d36965ff79
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * 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.jpa1.context.java;
+
+import java.util.Iterator;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
+import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
+import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
+import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
+import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.db.Table;
+import org.eclipse.jpt.utility.Filter;
+
+
+public class GenericJavaOrderable
+ extends AbstractJavaJpaContextNode
+ implements JavaOrderable2_0
+{
+ protected String specifiedOrderBy = null;
+ protected boolean noOrdering = false;
+ protected boolean pkOrdering = false;
+ protected boolean customOrdering = false;
+
+ protected boolean orderColumnOrdering = false;
+ protected final JavaOrderColumn2_0 orderColumn;
+
+ protected String specifiedMapKey;
+ protected boolean noMapKey = false;
+ protected boolean pkMapKey = false;
+ protected boolean customMapKey = false;
+
+
+ public GenericJavaOrderable(JavaAttributeMapping parent) {
+ super(parent);
+ this.orderColumn = ((JpaFactory2_0) getJpaFactory()).buildJavaOrderColumn(this, this);
+ }
+
+ public void initialize() {
+ this.initializeOrdering();
+ }
+
+ public void update() {
+ this.updateOrdering();
+ }
+
+ @Override
+ public JavaAttributeMapping getParent() {
+ return (JavaAttributeMapping) super.getParent();
+ }
+
+ protected JavaPersistentAttribute getPersistentAttribute() {
+ return getParent().getPersistentAttribute();
+ }
+
+ protected JavaResourcePersistentAttribute getResourcePersistentAttribute() {
+ return this.getPersistentAttribute().getResourcePersistentAttribute();
+ }
+
+
+ // ********** JavaBaseColumn.Owner implementation **********
+
+ public Table getDbTable(String tableName) {
+ return this.getTypeMapping().getDbTable(tableName);
+ }
+
+ public String getDefaultColumnName() {
+ return getPersistentAttribute().getName() + "_ORDER"; //$NON-NLS-1$
+ }
+
+ public TypeMapping getTypeMapping() {
+ return getPersistentAttribute().getTypeMapping();
+ }
+
+ // ********** order by **********
+
+ public String getSpecifiedOrderBy() {
+ return this.specifiedOrderBy;
+ }
+
+ public void setSpecifiedOrderBy(String orderBy) {
+ String old = this.specifiedOrderBy;
+ this.specifiedOrderBy = orderBy;
+ OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
+ if (orderBy == null) {
+ if (orderByAnnotation != null) {
+ this.removeOrderByAnnotation();
+ }
+ } else {
+ if (orderByAnnotation == null) {
+ orderByAnnotation = this.addOrderByAnnotation();
+ }
+ orderByAnnotation.setValue(orderBy);
+ }
+ this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
+ }
+
+ protected void setSpecifiedOrderBy_(String orderBy) {
+ String old = this.specifiedOrderBy;
+ this.specifiedOrderBy = orderBy;
+ this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
+ }
+
+ protected void initializeOrdering() {
+ OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
+ OrderColumn2_0Annotation orderColumnAnnotation = this.getOrderColumnAnnotation();
+ if (orderByAnnotation == null && orderColumnAnnotation == null) {
+ this.noOrdering = true;
+ } else if (orderByAnnotation != null){
+ this.specifiedOrderBy = orderByAnnotation.getValue();
+ if (this.specifiedOrderBy == null) {
+ this.pkOrdering = true;
+ } else {
+ this.customOrdering = true;
+ }
+ } else {
+ this.orderColumnOrdering = true;
+ this.orderColumn.initialize(orderColumnAnnotation);
+ }
+ }
+
+ protected void updateOrdering() {
+ OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
+ OrderColumn2_0Annotation orderColumnAnnotation = this.getOrderColumnAnnotation();
+ if (orderByAnnotation == null && orderColumnAnnotation == null) {
+ this.setSpecifiedOrderBy_(null);
+ this.setNoOrdering_(true);
+ this.setPkOrdering_(false);
+ this.setCustomOrdering_(false);
+ this.setOrderColumnOrdering_(false);
+ } else if (orderByAnnotation != null) {
+ String ob = orderByAnnotation.getValue();
+ this.setSpecifiedOrderBy_(ob);
+ this.setNoOrdering_(false);
+ this.setPkOrdering_(ob == null);
+ this.setCustomOrdering_(ob != null);
+ this.setOrderColumnOrdering_(false);
+ } else {
+ this.setSpecifiedOrderBy_(null);
+ this.setNoOrdering_(false);
+ this.setPkOrdering_(false);
+ this.setCustomOrdering_(false);
+ this.setOrderColumnOrdering_(true);
+ this.orderColumn.update(orderColumnAnnotation);
+ }
+ }
+
+ protected OrderByAnnotation getOrderByAnnotation() {
+ return (OrderByAnnotation) this.getResourcePersistentAttribute().getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
+ }
+
+ protected OrderByAnnotation addOrderByAnnotation() {
+ return (OrderByAnnotation) this.getResourcePersistentAttribute().addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
+ }
+
+ protected void removeOrderByAnnotation() {
+ this.getResourcePersistentAttribute().removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
+ }
+
+
+ // ********** no ordering **********
+
+ public boolean isNoOrdering() {
+ return this.noOrdering;
+ }
+
+ public void setNoOrdering(boolean noOrdering) {
+ boolean old = this.noOrdering;
+ this.noOrdering = noOrdering;
+ if (noOrdering) {
+ if (this.getOrderByAnnotation() != null) {
+ this.removeOrderByAnnotation();
+ }
+ if (this.getOrderColumnAnnotation() != null) {
+ this.removeOrderColumnAnnotation();
+ }
+ } else {
+ // the 'noOrdering' flag is cleared as a
+ // side-effect of setting the other flags,
+ // via a call to #setNoOrdering_(boolean)
+ }
+ this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
+ }
+
+ protected void setNoOrdering_(boolean noOrdering) {
+ boolean old = this.noOrdering;
+ this.noOrdering = noOrdering;
+ this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
+ }
+
+
+ // ********** pk ordering **********
+
+ public boolean isPkOrdering() {
+ return this.pkOrdering;
+ }
+
+ public void setPkOrdering(boolean pkOrdering) {
+ boolean old = this.pkOrdering;
+ this.pkOrdering = pkOrdering;
+ OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
+ if (pkOrdering) {
+ if (orderByAnnotation == null) {
+ this.addOrderByAnnotation();
+ } else {
+ orderByAnnotation.setValue(null);
+ }
+ } else {
+ // the 'pkOrdering' flag is cleared as a
+ // side-effect of setting the other flags,
+ // via a call to #setPkOrdering_(boolean)
+ }
+ this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
+ }
+
+ protected void setPkOrdering_(boolean pkOrdering) {
+ boolean old = this.pkOrdering;
+ this.pkOrdering = pkOrdering;
+ this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
+ }
+
+
+ // ********** custom ordering **********
+
+ public boolean isCustomOrdering() {
+ return this.customOrdering;
+ }
+
+ public void setCustomOrdering(boolean customOrdering) {
+ boolean old = this.customOrdering;
+ this.customOrdering = customOrdering;
+ if (customOrdering) {
+ this.setSpecifiedOrderBy(""); //$NON-NLS-1$
+ } else {
+ // the 'customOrdering' flag is cleared as a
+ // side-effect of setting the other flags,
+ // via a call to #setCustomOrdering_(boolean)
+ }
+ this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
+ }
+
+ protected void setCustomOrdering_(boolean customOrdering) {
+ boolean old = this.customOrdering;
+ this.customOrdering = customOrdering;
+ this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
+ }
+
+ // ********** order column 2.0 **********
+
+ public boolean isOrderColumnOrdering() {
+ return this.orderColumnOrdering;
+ }
+
+ public void setOrderColumnOrdering(boolean orderColumnOrdering) {
+ boolean old = this.orderColumnOrdering;
+ this.orderColumnOrdering = orderColumnOrdering;
+ OrderColumn2_0Annotation orderColumnAnnotation = this.getOrderColumnAnnotation();
+ if (orderColumnOrdering) {
+ if (orderColumnAnnotation == null) {
+ this.addOrderColumnAnnotation();
+ }
+ this.removeOrderByAnnotation();
+ } else {
+ removeOrderColumnAnnotation();
+ }
+ this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
+ }
+
+ protected void setOrderColumnOrdering_(boolean orderColumnOrdering) {
+ boolean old = this.orderColumnOrdering;
+ this.orderColumnOrdering = orderColumnOrdering;
+ this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
+ }
+
+ public JavaOrderColumn2_0 getOrderColumn() {
+ return this.orderColumn;
+ }
+
+ protected OrderColumn2_0Annotation getOrderColumnAnnotation() {
+ return (OrderColumn2_0Annotation) this.getResourcePersistentAttribute().getAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
+ }
+
+ protected OrderColumn2_0Annotation addOrderColumnAnnotation() {
+ return (OrderColumn2_0Annotation) this.getResourcePersistentAttribute().addAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
+ }
+
+ protected void removeOrderColumnAnnotation() {
+ this.getResourcePersistentAttribute().removeAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
+ }
+
+
+ // ********** Java completion proposals **********
+
+ @Override
+ public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
+ Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
+ if (result != null) {
+ return result;
+ }
+ result = this.getOrderColumn().javaCompletionProposals(pos, filter, astRoot);
+ if (result != null) {
+ return result;
+ }
+ return null;
+ }
+
+
+ // ********** validation **********
+
+ public TextRange getValidationTextRange(CompilationUnit astRoot) {
+ TextRange textRange = this.getOrderByAnnotationTextRange(astRoot);
+ return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
+ }
+
+ protected TextRange getOrderByAnnotationTextRange(CompilationUnit astRoot) {
+ OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
+ return (orderByAnnotation == null) ? null : orderByAnnotation.getTextRange(astRoot);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java
index 23b3ada09b..bdc14fcb28 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java
@@ -93,11 +93,6 @@ public class GenericJavaPrimaryKeyJoinColumn extends AbstractJavaNamedColumn<Pri
return getOwner().isVirtual(this);
}
- @Override
- protected String getTableName() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
public Column getReferencedDbColumn() {
Table table = this.getReferencedColumnDbTable();
return (table == null) ? null : table.getColumnForIdentifier(this.getReferencedColumnName());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java
index b3fbae1658..ef90cfc1df 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java
@@ -57,9 +57,7 @@ public class GenericOrmColumn extends AbstractOrmBaseColumn<XmlColumn> implement
if (this.valuesAreDifferent(oldSpecifiedLength, newSpecifiedLength)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setLength(newSpecifiedLength);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedLength != null) {
addResourceColumn();
@@ -93,9 +91,7 @@ public class GenericOrmColumn extends AbstractOrmBaseColumn<XmlColumn> implement
if (this.valuesAreDifferent(oldSpecifiedPrecision, newSpecifiedPrecision)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setPrecision(newSpecifiedPrecision);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedPrecision != null) {
addResourceColumn();
@@ -129,9 +125,7 @@ public class GenericOrmColumn extends AbstractOrmBaseColumn<XmlColumn> implement
if (this.valuesAreDifferent(oldSpecifiedScale, newSpecifiedScale)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setScale(newSpecifiedScale);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedScale != null) {
addResourceColumn();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java
index f646db22c1..ab4649463a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java
@@ -71,9 +71,7 @@ public class GenericOrmDiscriminatorColumn extends AbstractOrmNamedColumn<XmlDis
if (oldDiscriminatorType != newSpecifiedDiscriminatorType) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setDiscriminatorType(DiscriminatorType.toOrmResourceModel(newSpecifiedDiscriminatorType));
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedDiscriminatorType != null) {
addResourceColumn();
@@ -113,9 +111,7 @@ public class GenericOrmDiscriminatorColumn extends AbstractOrmNamedColumn<XmlDis
if (this.valuesAreDifferent(oldSpecifiedLength, newSpecifiedLength)) {
if (this.getResourceColumn() != null) {
this.getResourceColumn().setLength(newSpecifiedLength);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
+ this.removeResourceColumnIfFeaturesUnset();
}
else if (newSpecifiedLength != null) {
addResourceColumn();
@@ -130,12 +126,6 @@ public class GenericOrmDiscriminatorColumn extends AbstractOrmNamedColumn<XmlDis
this.specifiedLength = newSpecifiedLength;
firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
}
-
- @Override
- protected String getOwningTableName() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java
new file mode 100644
index 0000000000..0a8801b6d1
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 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.jpa1.context.orm;
+
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
+import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
+import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
+import org.eclipse.jpt.core.resource.orm.OrmFactory;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
+import org.eclipse.jpt.core.resource.orm.XmlOrderable;
+import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.db.Table;
+
+/**
+ * ORM multi-relationship (m:m, 1:m) mapping
+ */
+public class GenericOrmOrderable
+ extends AbstractOrmXmlContextNode
+ implements OrmOrderable2_0
+{
+ protected String specifiedOrderBy;
+ protected boolean noOrdering = false;
+ protected boolean pkOrdering = false;
+ protected boolean customOrdering = false;
+
+ protected boolean orderColumnOrdering = false;
+ protected final OrmOrderColumn2_0 orderColumn;
+
+
+ protected String specifiedMapKey;
+ protected boolean noMapKey = false;
+ protected boolean pkMapKey = false;
+ protected boolean customMapKey = false;
+
+
+ public GenericOrmOrderable(OrmAttributeMapping parent) {
+ super(parent);
+ this.orderColumn = ((OrmXml2_0ContextNodeFactory) getXmlContextNodeFactory()).buildOrmOrderColumn(this, this);
+ this.initializeOrdering();
+ }
+
+ public void update() {
+ this.updateOrdering();
+ }
+
+ @Override
+ public OrmAttributeMapping getParent() {
+ return (OrmAttributeMapping) super.getParent();
+ }
+
+ protected OrmPersistentAttribute getPersistentAttribute() {
+ return getParent().getPersistentAttribute();
+ }
+
+ protected XmlOrderable getResourceOrderable() {
+ return (XmlOrderable) getParent().getResourceAttributeMapping();
+ }
+
+ // **************** order by ***********************************************
+
+ public String getSpecifiedOrderBy() {
+ return this.specifiedOrderBy;
+ }
+
+ public void setSpecifiedOrderBy(String orderBy) {
+ String old = this.specifiedOrderBy;
+ this.specifiedOrderBy = orderBy;
+ this.getResourceOrderable().setOrderBy(orderBy);
+ this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
+ }
+
+ protected void setSpecifiedOrderBy_(String orderBy) {
+ String old = this.specifiedOrderBy;
+ this.specifiedOrderBy = orderBy;
+ this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
+ }
+
+ protected void initializeOrdering() {
+ this.specifiedOrderBy = this.getXmlOrderBy();
+ XmlOrderColumn resourceOrderColumn = getXmlOrderColumn();
+ if (this.specifiedOrderBy == null && resourceOrderColumn == null) {
+ this.noOrdering = true;
+ } else if (this.specifiedOrderBy != null && this.specifiedOrderBy.equals("")) { //$NON-NLS-1$
+ this.pkOrdering = true;
+ } else if (resourceOrderColumn == null) {
+ this.customOrdering = true;
+ } else {
+ this.orderColumnOrdering = true;
+ }
+ }
+
+ protected void updateOrdering() {
+ this.setSpecifiedOrderBy_(this.getXmlOrderBy());
+ XmlOrderColumn resourceOrderColumn = getXmlOrderColumn();
+ if (this.specifiedOrderBy == null && resourceOrderColumn == null) {
+ this.setNoOrdering_(true);
+ this.setPkOrdering_(false);
+ this.setCustomOrdering_(false);
+ this.setOrderColumnOrdering_(false);
+ } else if (this.specifiedOrderBy != null && this.specifiedOrderBy.equals("")) { //$NON-NLS-1$
+ this.setNoOrdering_(false);
+ this.setPkOrdering_(true);
+ this.setCustomOrdering_(false);
+ this.setOrderColumnOrdering_(false);
+ } else if (resourceOrderColumn == null){
+ this.setNoOrdering_(false);
+ this.setPkOrdering_(false);
+ this.setCustomOrdering_(true);
+ this.setOrderColumnOrdering_(false);
+ } else {
+ this.setNoOrdering_(false);
+ this.setPkOrdering_(false);
+ this.setCustomOrdering_(false);
+ this.setOrderColumnOrdering_(true);
+ }
+ this.orderColumn.update(this.getResourceOrderable());
+ }
+
+ protected String getXmlOrderBy() {
+ return this.getResourceOrderable().getOrderBy();
+ }
+
+ protected XmlOrderColumn getXmlOrderColumn() {
+ return ((XmlOrderable_2_0) this.getResourceOrderable()).getOrderColumn();
+ }
+
+ // **************** no ordering ***********************************************
+
+ public boolean isNoOrdering() {
+ return this.noOrdering;
+ }
+
+ public void setNoOrdering(boolean noOrdering) {
+ boolean old = this.noOrdering;
+ this.noOrdering = noOrdering;
+ if (noOrdering) {
+ this.getResourceOrderable().setOrderBy(null);
+ this.removeXmlOrderColumn();
+ }
+ this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
+ }
+
+ protected void setNoOrdering_(boolean noOrdering) {
+ boolean old = this.noOrdering;
+ this.noOrdering = noOrdering;
+ this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
+ }
+
+
+ // **************** pk ordering ***********************************************
+
+ public boolean isPkOrdering() {
+ return this.pkOrdering;
+ }
+
+ public void setPkOrdering(boolean pkOrdering) {
+ boolean old = this.pkOrdering;
+ this.pkOrdering = pkOrdering;
+ if (pkOrdering) {
+ this.getResourceOrderable().setOrderBy(""); //$NON-NLS-1$
+ this.removeXmlOrderColumn();
+ }
+ this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
+ }
+
+ protected void setPkOrdering_(boolean pkOrdering) {
+ boolean old = this.pkOrdering;
+ this.pkOrdering = pkOrdering;
+ this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
+ }
+
+
+ // **************** custom ordering ***********************************************
+
+ public boolean isCustomOrdering() {
+ return this.customOrdering;
+ }
+
+ public void setCustomOrdering(boolean customOrdering) {
+ boolean old = this.customOrdering;
+ this.customOrdering = customOrdering;
+ if (customOrdering) {
+ this.setSpecifiedOrderBy(""); //$NON-NLS-1$
+ this.removeXmlOrderColumn();
+ }
+ this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
+ }
+
+ protected void setCustomOrdering_(boolean customOrdering) {
+ boolean old = this.customOrdering;
+ this.customOrdering = customOrdering;
+ this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
+ }
+
+ // **************** order column ordering ***********************************************
+
+ public boolean isOrderColumnOrdering() {
+ return this.orderColumnOrdering;
+ }
+
+ public void setOrderColumnOrdering(boolean orderColumnOrdering) {
+ boolean old = this.orderColumnOrdering;
+ this.orderColumnOrdering = orderColumnOrdering;
+ if (orderColumnOrdering) {
+ this.getResourceOrderable().setOrderBy(null);
+ addXmlOrderColumn();
+ }
+ this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
+ }
+
+ protected void setOrderColumnOrdering_(boolean orderColumnOrdering) {
+ boolean old = this.orderColumnOrdering;
+ this.orderColumnOrdering = orderColumnOrdering;
+ this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
+ }
+
+ public OrmOrderColumn2_0 getOrderColumn() {
+ return this.orderColumn;
+ }
+
+ protected void addXmlOrderColumn() {
+ ((XmlOrderable_2_0) getResourceOrderable()).setOrderColumn(OrmFactory.eINSTANCE.createXmlOrderColumn());
+ }
+
+ protected void removeXmlOrderColumn() {
+ ((XmlOrderable_2_0) getResourceOrderable()).setOrderColumn(null);
+ }
+
+
+ // ********** OrderColumn OrmBaseColumn.Owner implementation **********
+
+ public Table getDbTable(String tableName) {
+ return this.getTypeMapping().getDbTable(tableName);
+ }
+
+ public String getDefaultColumnName() {
+ return getPersistentAttribute().getName() + "_ORDER"; //$NON-NLS-1$
+ }
+
+ public TypeMapping getTypeMapping() {
+ return getPersistentAttribute().getTypeMapping();
+ }
+
+
+ public TextRange getValidationTextRange() {
+ return getResourceOrderable().getValidationTextRange();
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java
index b469580539..191a210112 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java
@@ -100,11 +100,6 @@ public class GenericOrmPrimaryKeyJoinColumn extends AbstractOrmNamedColumn<XmlPr
return getOwner().getReferencedColumnDbTable();
}
- @Override
- protected String getOwningTableName() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
public boolean isReferencedColumnResolved() {
return getReferencedDbColumn() != null;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java
new file mode 100644
index 0000000000..0f8a5e5e34
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * 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.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.context.BaseColumn;
+import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.core.context.java.JavaNamedColumn;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaNamedColumn;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
+import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
+import org.eclipse.jpt.core.utility.TextRange;
+
+
+public class GenericJavaOrderColumn2_0
+ extends AbstractJavaNamedColumn<OrderColumn2_0Annotation>
+ implements JavaOrderColumn2_0
+{
+ protected Boolean specifiedNullable;
+
+ protected Boolean specifiedInsertable;
+
+ protected Boolean specifiedUpdatable;
+
+ protected JavaResourcePersistentMember persistenceResource;
+
+
+ public GenericJavaOrderColumn2_0(JavaJpaContextNode parent, JavaNamedColumn.Owner owner) {
+ super(parent, owner);
+ }
+
+ @Override
+ public void initialize(OrderColumn2_0Annotation column) {
+ super.initialize(column);
+ this.specifiedNullable = this.getResourceNullable(column);
+ this.specifiedInsertable = this.getResourceInsertable(column);
+ this.specifiedUpdatable = this.getResourceUpdatable(column);
+ }
+
+ public boolean isNullable() {
+ return (this.getSpecifiedNullable() == null) ? this.isDefaultNullable() : this.getSpecifiedNullable().booleanValue();
+ }
+
+ public boolean isDefaultNullable() {
+ return BaseColumn.DEFAULT_NULLABLE;
+ }
+
+ public Boolean getSpecifiedNullable() {
+ return this.specifiedNullable;
+ }
+
+ public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
+ Boolean oldSpecifiedNullable = this.specifiedNullable;
+ this.specifiedNullable = newSpecifiedNullable;
+ this.getResourceColumn().setNullable(newSpecifiedNullable);
+ firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
+ }
+
+ /**
+ * internal setter used only for updating from the resource model.
+ * There were problems with InvalidThreadAccess exceptions in the UI
+ * when you set a value from the UI and the annotation doesn't exist yet.
+ * Adding the annotation causes an update to occur and then the exception.
+ */
+ protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
+ Boolean oldSpecifiedNullable = this.specifiedNullable;
+ this.specifiedNullable = newSpecifiedNullable;
+ firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
+ }
+
+ public boolean isInsertable() {
+ return (this.getSpecifiedInsertable() == null) ? this.isDefaultInsertable() : this.getSpecifiedInsertable().booleanValue();
+ }
+
+ public boolean isDefaultInsertable() {
+ return BaseColumn.DEFAULT_INSERTABLE;
+ }
+
+ public Boolean getSpecifiedInsertable() {
+ return this.specifiedInsertable;
+ }
+
+ public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
+ Boolean oldSpecifiedInsertable = this.specifiedInsertable;
+ this.specifiedInsertable = newSpecifiedInsertable;
+ this.getResourceColumn().setInsertable(newSpecifiedInsertable);
+ firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
+ }
+
+ /**
+ * internal setter used only for updating from the resource model.
+ * There were problems with InvalidThreadAccess exceptions in the UI
+ * when you set a value from the UI and the annotation doesn't exist yet.
+ * Adding the annotation causes an update to occur and then the exception.
+ */
+ protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
+ Boolean oldSpecifiedInsertable = this.specifiedInsertable;
+ this.specifiedInsertable = newSpecifiedInsertable;
+ firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
+ }
+
+ public boolean isUpdatable() {
+ return (this.getSpecifiedUpdatable() == null) ? this.isDefaultUpdatable() : this.getSpecifiedUpdatable().booleanValue();
+ }
+
+ public boolean isDefaultUpdatable() {
+ return BaseColumn.DEFAULT_UPDATABLE;
+ }
+
+ public Boolean getSpecifiedUpdatable() {
+ return this.specifiedUpdatable;
+ }
+
+ public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
+ Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
+ this.specifiedUpdatable = newSpecifiedUpdatable;
+ this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
+ firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
+ }
+
+ /**
+ * internal setter used only for updating from the resource model.
+ * There were problems with InvalidThreadAccess exceptions in the UI
+ * when you set a value from the UI and the annotation doesn't exist yet.
+ * Adding the annotation causes an update to occur and then the exception.
+ */
+ protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
+ Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
+ this.specifiedUpdatable = newSpecifiedUpdatable;
+ firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
+ }
+
+ public TextRange getValidationTextRange(CompilationUnit astRoot) {
+ TextRange textRange = getResourceColumn().getTextRange(astRoot);
+ return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
+ }
+
+ @Override
+ public void update(OrderColumn2_0Annotation column) {
+ super.update(column);
+ this.setSpecifiedNullable_(this.getResourceNullable(column));
+ this.setSpecifiedInsertable_(this.getResourceInsertable(column));
+ this.setSpecifiedUpdatable_(this.getResourceUpdatable(column));
+ }
+
+ protected Boolean getResourceNullable(OrderColumn2_0Annotation column) {
+ return column.getNullable();
+ }
+
+ protected Boolean getResourceInsertable(OrderColumn2_0Annotation column) {
+ return column.getInsertable();
+ }
+
+ protected Boolean getResourceUpdatable(OrderColumn2_0Annotation column) {
+ return column.getUpdatable();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java
new file mode 100644
index 0000000000..864252f7ea
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java
@@ -0,0 +1,211 @@
+/*******************************************************************************
+ * 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.orm;
+
+import org.eclipse.jpt.core.context.BaseColumn;
+import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
+import org.eclipse.jpt.core.internal.context.orm.AbstractOrmNamedColumn;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
+import org.eclipse.jpt.core.resource.orm.OrmFactory;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
+import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
+import org.eclipse.jpt.core.utility.TextRange;
+
+
+public class GenericOrmOrderColumn2_0
+ extends AbstractOrmNamedColumn<XmlOrderColumn>
+ implements OrmOrderColumn2_0
+{
+ protected Boolean specifiedNullable;
+
+ protected Boolean specifiedInsertable;
+
+ protected Boolean specifiedUpdatable;
+
+ protected XmlOrderable_2_0 xmlOrderable;
+
+ public GenericOrmOrderColumn2_0(OrmOrderable2_0 parent, OrmNamedColumn.Owner owner) {
+ super(parent, owner);
+ }
+
+ @Override
+ public XmlOrderColumn getResourceColumn() {
+ return this.xmlOrderable.getOrderColumn();
+ }
+
+ @Override
+ protected void addResourceColumn() {
+ this.xmlOrderable.setOrderColumn(OrmFactory.eINSTANCE.createXmlOrderColumn());
+ }
+
+ @Override
+ protected void removeResourceColumn() {
+ this.xmlOrderable.setOrderColumn(null);
+ }
+
+ public boolean isResourceSpecified() {
+ return getResourceColumn() != null;
+ }
+
+ @Override
+ protected void removeResourceColumnIfFeaturesUnset() {
+ //override to do nothing
+ //don't want to remove the order-column element if it's features are all set to null
+ }
+
+ public boolean isNullable() {
+ return (this.getSpecifiedNullable() == null) ? this.isDefaultNullable() : this.getSpecifiedNullable().booleanValue();
+ }
+
+ public boolean isDefaultNullable() {
+ return BaseColumn.DEFAULT_NULLABLE;
+ }
+
+ public Boolean getSpecifiedNullable() {
+ return this.specifiedNullable;
+ }
+
+ public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
+ Boolean oldSpecifiedNullable = this.specifiedNullable;
+ this.specifiedNullable = newSpecifiedNullable;
+ if (this.valuesAreDifferent(oldSpecifiedNullable, newSpecifiedNullable)) {
+ if (this.getResourceColumn() != null) {
+ this.getResourceColumn().setNullable(newSpecifiedNullable);
+ this.removeResourceColumnIfFeaturesUnset();
+ }
+ else if (newSpecifiedNullable != null) {
+ addResourceColumn();
+ getResourceColumn().setNullable(newSpecifiedNullable);
+ }
+ }
+ firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
+ }
+
+ protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
+ Boolean oldSpecifiedNullable = this.specifiedNullable;
+ this.specifiedNullable = newSpecifiedNullable;
+ firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
+ }
+
+ public boolean isInsertable() {
+ return (this.getSpecifiedInsertable() == null) ? this.isDefaultInsertable() : this.getSpecifiedInsertable().booleanValue();
+ }
+
+ public boolean isDefaultInsertable() {
+ return BaseColumn.DEFAULT_INSERTABLE;
+ }
+
+ public Boolean getSpecifiedInsertable() {
+ return this.specifiedInsertable;
+ }
+
+ public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
+ Boolean oldSpecifiedInsertable = this.specifiedInsertable;
+ this.specifiedInsertable = newSpecifiedInsertable;
+ if (this.valuesAreDifferent(oldSpecifiedInsertable, newSpecifiedInsertable)) {
+ if (this.getResourceColumn() != null) {
+ this.getResourceColumn().setInsertable(newSpecifiedInsertable);
+ this.removeResourceColumnIfFeaturesUnset();
+ }
+ else if (newSpecifiedInsertable != null) {
+ addResourceColumn();
+ getResourceColumn().setInsertable(newSpecifiedInsertable);
+ }
+ }
+ firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
+ }
+
+ protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
+ Boolean oldSpecifiedInsertable = this.specifiedInsertable;
+ this.specifiedInsertable = newSpecifiedInsertable;
+ firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
+ }
+
+ public boolean isUpdatable() {
+ return (this.getSpecifiedUpdatable() == null) ? this.isDefaultUpdatable() : this.getSpecifiedUpdatable().booleanValue();
+ }
+
+ public boolean isDefaultUpdatable() {
+ return BaseColumn.DEFAULT_UPDATABLE;
+ }
+
+ public Boolean getSpecifiedUpdatable() {
+ return this.specifiedUpdatable;
+ }
+
+ public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
+ Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
+ this.specifiedUpdatable = newSpecifiedUpdatable;
+ if (this.valuesAreDifferent(oldSpecifiedUpdatable, newSpecifiedUpdatable)) {
+ if (this.getResourceColumn() != null) {
+ this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
+ this.removeResourceColumnIfFeaturesUnset();
+ }
+ else if (newSpecifiedUpdatable != null) {
+ addResourceColumn();
+ getResourceColumn().setUpdatable(newSpecifiedUpdatable);
+ }
+ }
+ firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
+ }
+
+ protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
+ Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
+ this.specifiedUpdatable = newSpecifiedUpdatable;
+ firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
+ }
+
+ public void initialize(XmlOrderable_2_0 xmlOrderable) {
+ this.xmlOrderable = xmlOrderable;
+ this.initialize(this.getResourceColumn());
+ }
+
+ public void update(XmlOrderable_2_0 xmlOrderable) {
+ this.xmlOrderable = xmlOrderable;
+ this.update(this.getResourceColumn());
+ }
+
+ @Override
+ protected void initialize(XmlOrderColumn column) {
+ super.initialize(column);
+ this.specifiedNullable = this.getResourceNullable(column);
+ this.specifiedUpdatable = this.getResourceUpdatable(column);
+ this.specifiedInsertable = this.getResourceInsertable(column);
+ }
+
+ @Override
+ protected void update(XmlOrderColumn column) {
+ super.update(column);
+ setSpecifiedNullable_(this.getResourceNullable(column));
+ setSpecifiedUpdatable_(this.getResourceUpdatable(column));
+ setSpecifiedInsertable_(this.getResourceInsertable(column));
+ }
+
+ protected Boolean getResourceNullable(XmlOrderColumn column) {
+ return column == null ? null : column.getNullable();
+ }
+
+ protected Boolean getResourceUpdatable(XmlOrderColumn column) {
+ return column == null ? null : column.getUpdatable();
+ }
+
+
+ protected Boolean getResourceInsertable(XmlOrderColumn column) {
+ return column == null ? null : column.getInsertable();
+ }
+
+ @Override
+ public TextRange getValidationTextRange() {
+ TextRange textRange = getResourceColumn().getValidationTextRange();
+ return (textRange != null) ? textRange : this.getOwner().getValidationTextRange();
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java
index 1681648379..8a7fcac676 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java
@@ -20,6 +20,7 @@ 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.resource.orm.XmlManyToMany;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
/**
@@ -142,6 +143,11 @@ public class VirtualXmlManyToMany2_0 extends XmlManyToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ return this.virtualXmlManyToMany.getOrderColumn();
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return this.virtualXmlManyToMany.getMappedByTextRange();
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java
index 7fc508e126..cce837f50d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java
@@ -23,6 +23,7 @@ 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.resource.orm.XmlOneToMany;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
/**
@@ -160,6 +161,11 @@ public class VirtualXmlOneToMany2_0 extends XmlOneToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ return this.virtualXmlOneToMany.getOrderColumn();
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return this.virtualXmlOneToMany.getMappedByTextRange();
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java
index ef5a9cd4b3..86cb77d662 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java
@@ -11,6 +11,8 @@ package org.eclipse.jpt.core.internal.jpa2.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedColumnAnnotation;
+import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
@@ -79,6 +81,16 @@ public class SourceOrderColumn2_0Annotation
this.setUpdatable(this.buildUpdatable(astRoot));
}
+ @Override
+ protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
+ return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName, false);
+ }
+
+ @Override
+ protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
+ return new ConversionDeclarationAnnotationElementAdapter<Boolean>(this.daa, elementName, false, BooleanExpressionConverter.instance());
+ }
+
public String getAnnotationName() {
return ANNOTATION_NAME;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
index 639b03f8ca..76e30cf024 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
@@ -56,7 +56,7 @@ public abstract class SourceNamedColumnAnnotation
this.columnDefinitionAdapter = this.buildShortCircuitElementAdapter(this.columnDefinitionDeclarationAdapter);
}
- DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
+ protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java
index 12835510ca..0cd9c0cac3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java
@@ -13,6 +13,7 @@ import org.eclipse.jpt.core.JpaFactory;
import org.eclipse.jpt.core.context.AssociationOverrideContainer;
import org.eclipse.jpt.core.context.PersistentType;
import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
+import org.eclipse.jpt.core.context.java.JavaNamedColumn;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
@@ -20,6 +21,8 @@ import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedId2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaMapsId2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_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.context.java.JavaSingleRelationshipMapping2_0;
@@ -59,4 +62,6 @@ public interface JpaFactory2_0
JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent);
JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent);
+
+ JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java
new file mode 100644
index 0000000000..77f8d03e0c
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.jpa2.context;
+
+import org.eclipse.jpt.core.context.NamedColumn;
+
+/**
+ *
+ *
+ * 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.
+ */
+public interface OrderColumn2_0 extends NamedColumn
+{
+
+ boolean isNullable();
+
+ boolean isDefaultNullable();
+ String DEFAULT_NULLABLE_PROPERTY = "defaultNullable"; //$NON-NLS-1$
+ boolean DEFAULT_NULLABLE = true;
+ Boolean getSpecifiedNullable();
+ void setSpecifiedNullable(Boolean newSpecifiedNullable);
+ String SPECIFIED_NULLABLE_PROPERTY = "specifiedNullable"; //$NON-NLS-1$
+
+
+ boolean isInsertable();
+
+ boolean isDefaultInsertable();
+ String DEFAULT_INSERTABLE_PROPERTY = "defaultInsertable"; //$NON-NLS-1$
+ boolean DEFAULT_INSERTABLE = true;
+ Boolean getSpecifiedInsertable();
+ void setSpecifiedInsertable(Boolean newSpecifiedInsertable);
+ String SPECIFIED_INSERTABLE_PROPERTY = "specifiedInsertable"; //$NON-NLS-1$
+
+
+ boolean isUpdatable();
+
+ boolean isDefaultUpdatable();
+ String DEFAULT_UPDATABLE_PROPERTY = "defaultUpdatable"; //$NON-NLS-1$
+ boolean DEFAULT_UPDATABLE = true;
+ Boolean getSpecifiedUpdatable();
+ void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable);
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java
new file mode 100644
index 0000000000..baaf377ac6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.jpa2.context;
+
+import org.eclipse.jpt.core.context.Orderable;
+
+/**
+ * Multi-valued (1:m, m:m) relationship mappings support ordering.
+ * <p>
+ * 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.
+ */
+public interface Orderable2_0
+ extends Orderable
+{
+
+ boolean isOrderColumnOrdering();
+ void setOrderColumnOrdering(boolean orderColumn);
+ String ORDER_COLUMN_ORDERING_PROPERTY = "orderColumnOrdering"; //$NON-NLS-1$
+
+ OrderColumn2_0 getOrderColumn();
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java
new file mode 100644
index 0000000000..334dccce7a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.jpa2.context.java;
+
+import org.eclipse.jpt.core.context.java.JavaNamedColumn;
+import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
+
+/**
+ *
+ *
+ * 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.
+ */
+public interface JavaOrderColumn2_0
+ extends
+ OrderColumn2_0,
+ JavaNamedColumn
+{
+ void initialize(OrderColumn2_0Annotation resourceColumn);
+
+ /**
+ * Update the JavaColumn context model object to match the ColumnAnnotation
+ * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
+ */
+ void update(OrderColumn2_0Annotation resourceColumn);
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java
new file mode 100644
index 0000000000..21acdcd086
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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.jpa2.context.java;
+
+import org.eclipse.jpt.core.context.java.JavaNamedColumn;
+import org.eclipse.jpt.core.context.java.JavaOrderable;
+import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
+
+/**
+ *
+ * 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.
+ */
+public interface JavaOrderable2_0
+ extends Orderable2_0, JavaOrderable, JavaNamedColumn.Owner
+{
+ JavaOrderColumn2_0 getOrderColumn();
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java
new file mode 100644
index 0000000000..e1d75cf3e5
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.jpa2.context.orm;
+
+import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
+import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
+import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
+
+/**
+ *
+ *
+ * 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.
+ */
+public interface OrmOrderColumn2_0
+ extends
+ OrderColumn2_0,
+ OrmNamedColumn
+{
+ void initialize(XmlOrderable_2_0 orderable);
+
+ /**
+ * Update the OrmOrderColumn2_0 context model object to match the XmlOrderable2_0
+ * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
+ */
+ void update(XmlOrderable_2_0 orderable);
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java
new file mode 100644
index 0000000000..c250f9164b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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.jpa2.context.orm;
+
+import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
+import org.eclipse.jpt.core.context.orm.OrmOrderable;
+import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
+
+/**
+ *
+ * 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.
+ */
+public interface OrmOrderable2_0
+ extends Orderable2_0, OrmOrderable, OrmNamedColumn.Owner
+{
+ OrmOrderColumn2_0 getOrderColumn();
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java
index ce351c0245..9714788329 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java
@@ -10,6 +10,7 @@
package org.eclipse.jpt.core.jpa2.context.orm;
import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
+import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
@@ -45,4 +46,6 @@ public interface OrmXml2_0ContextNodeFactory extends OrmXmlContextNodeFactory
OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent, XmlCacheable_2_0 resource);
OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable_2_0 resource);
+
+ OrmOrderColumn2_0 buildOrmOrderColumn(OrmOrderable2_0 parent, OrmNamedColumn.Owner owner);
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java
index e45ef0812c..cc6151f20c 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java
@@ -18,6 +18,7 @@ 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.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkManyToManyMapping;
@@ -145,6 +146,11 @@ public class VirtualEclipseLinkXmlManyToMany extends XmlManyToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ return this.virtualXmlManyToMany.getOrderColumn();
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return this.virtualXmlManyToMany.getMappedByTextRange();
}
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 0c5fce4c4e..804ae659a8 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
@@ -24,6 +24,7 @@ import org.eclipse.jpt.core.resource.orm.MapKey;
import org.eclipse.jpt.core.resource.orm.OrmPackage;
import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
+import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
@@ -149,6 +150,11 @@ public class VirtualEclipseLinkXmlOneToMany extends XmlOneToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ return this.virtualXmlOneToMany.getOrderColumn();
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return this.virtualXmlOneToMany.getMappedByTextRange();
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java
index 016790b2af..280224484a 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java
@@ -18,6 +18,7 @@ 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.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlManyToMany;
import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
@@ -144,6 +145,11 @@ public class VirtualEclipseLinkXmlManyToMany1_1 extends XmlManyToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ return this.virtualXmlManyToMany.getOrderColumn();
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return this.virtualXmlManyToMany.getMappedByTextRange();
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java
index 5403c08ab2..1eae804a0c 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java
@@ -17,6 +17,7 @@ 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.resource.orm.XmlOrderColumn;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToMany;
@@ -141,6 +142,11 @@ public class VirtualEclipseLinkXmlOneToMany1_1 extends XmlOneToMany
}
@Override
+ public XmlOrderColumn getOrderColumn() {
+ return this.virtualXmlOneToMany.getOrderColumn();
+ }
+
+ @Override
public TextRange getMappedByTextRange() {
return this.virtualXmlOneToMany.getMappedByTextRange();
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
index 32d8350e8e..b868c5736c 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
@@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Composite;
*
* @see Fetchable
* @see BasicMappingComposite - A container of this widget
- * @see ManyToManyMappingComposite - A container of this widget
+ * @see JavaManyToManyMapping2_0Composite - A container of this widget
* @see ManyToOneMappingComposite - A container of this widget
* @see OneToManyMappingComposite - A container of this widget
* @see OneToOneMappingComposite - A container of this widget
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
index e0cc9e87b1..ac0477d749 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
@@ -9,21 +9,18 @@
******************************************************************************/
package org.eclipse.jpt.eclipselink.ui.internal.details;
-import org.eclipse.jpt.core.context.Cascade;
import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToManyRelationshipReference;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.internal.details.AbstractManyToManyMappingComposite;
import org.eclipse.jpt.ui.internal.details.CascadeComposite;
import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.widgets.FormPane;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
@@ -68,8 +65,8 @@ import org.eclipse.swt.widgets.Composite;
* @version 2.1
* @since 2.1
*/
-public class EclipseLinkManyToManyMappingComposite
- extends FormPane<ManyToManyMapping>
+public class EclipseLinkManyToManyMappingComposite
+ extends AbstractManyToManyMappingComposite<ManyToManyMapping>
implements JpaComposite
{
/**
@@ -98,29 +95,6 @@ public class EclipseLinkManyToManyMappingComposite
new OrderingComposite(this, container);
}
- protected Composite addPane(Composite container, int groupBoxMargin) {
- return addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
- protected PropertyValueModel<ManyToManyRelationshipReference> buildJoiningHolder() {
- return new TransformationPropertyValueModel<ManyToManyMapping, ManyToManyRelationshipReference>(
- getSubjectHolder()) {
- @Override
- protected ManyToManyRelationshipReference transform_(ManyToManyMapping value) {
- return value.getRelationshipReference();
- }
- };
- }
-
- protected PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<ManyToManyMapping, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(ManyToManyMapping value) {
- return value.getCascade();
- }
- };
- }
-
protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
return new PropertyAspectAdapter<ManyToManyMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
index 1958249e93..a27b66021e 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm;
-import org.eclipse.jpt.core.context.AccessHolder;
import org.eclipse.jpt.core.context.ManyToManyMapping;
import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
@@ -20,7 +19,6 @@ import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
@@ -93,13 +91,5 @@ public class OrmEclipseLinkManyToManyMapping1_1Composite extends EclipseLinkMany
new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
new OrderingComposite(this, container);
}
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToManyMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
+
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
index c953426091..e94cb94e18 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
@@ -25,6 +25,7 @@ import org.eclipse.jpt.ui.internal.details.CascadeComposite;
import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
+import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
@@ -109,7 +110,7 @@ public class JavaEclipseLinkOneToManyMapping2_0Composite<T extends EclipseLinkOn
new EclipseLinkPrivateOwnedComposite(this, this.buildPrivateOwnableHolder(), this.addPane(container, groupBoxMargin));
new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), this.addPane(container, groupBoxMargin));
new CascadeComposite(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- new OrderingComposite(this, container);
+ new Ordering2_0Composite(this, container);
}
protected PropertyValueModel<EclipseLinkOneToManyRelationshipReference> buildEclipseLinkJoiningHolder() {
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java
index a03bcb7f6b..4f2c1c9d37 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java
@@ -24,7 +24,6 @@ import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
import org.eclipse.jpt.eclipselink.ui.internal.details.orm.BaseEclipseLinkOrmXmlUiFactory;
import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkBasicMapping1_1Composite;
import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkEmbeddedIdMapping1_1Composite;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkManyToManyMapping1_1Composite;
import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkVersionMapping1_1Composite;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaComposite;
@@ -129,7 +128,7 @@ public class EclipseLinkOrmXml2_0UiFactory
PropertyValueModel<OrmManyToManyMapping> subjectHolder,
Composite parent,
WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMapping1_1Composite(subjectHolder, parent, widgetFactory);
+ return new OrmEclipseLinkManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
}
public JpaComposite createOrmElementCollectionMapping2_0Composite(
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java
new file mode 100644
index 0000000000..416e4a2b12
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * 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.ui.internal.v2_0.details.orm;
+
+import org.eclipse.jpt.core.context.ManyToManyMapping;
+import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
+import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
+import org.eclipse.jpt.ui.internal.details.CascadeComposite;
+import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
+import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
+import org.eclipse.jpt.ui.internal.details.OrderingComposite;
+import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Here the layout of this pane:
+ * <pre>
+ * -----------------------------------------------------------------------------
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | TargetEntityComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | JoiningStrategyComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | FetchTypeComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | CascadeComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | OrderingComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * -----------------------------------------------------------------------------</pre>
+ *
+ * @see {@link ManyToManyMapping}
+ * @see {@link TargetEntityComposite}
+ * @see {@link ManyToManyJoiningStrategyPane}
+ * @see {@link FetchTypeComposite}
+ * @see {@link CascadeComposite}
+ * @see {@link OrderingComposite}
+ *
+ * @version 2.2
+ * @since 2.2
+ */
+public class OrmEclipseLinkManyToManyMapping2_0Composite extends EclipseLinkManyToManyMappingComposite
+{
+ /**
+ * Creates a new <code>ManyToManyMappingComposite</code>.
+ *
+ * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create various common widgets
+ */
+ public OrmEclipseLinkManyToManyMapping2_0Composite(PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+
+ super(subjectHolder, parent, widgetFactory);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ int groupBoxMargin = getGroupBoxMargin();
+
+ new TargetEntityComposite(this, addPane(container, groupBoxMargin));
+ new ManyToManyJoiningStrategyPane(this, buildJoiningHolder(), container);
+ new AccessTypeComposite(this, buildAccessHolderHolder(), addPane(container, groupBoxMargin));
+ new FetchTypeComposite(this, addPane(container, groupBoxMargin));
+ new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), addPane(container, groupBoxMargin));
+ new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
+ new OrderingComposite(this, container);
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
index dc553d61fd..ae6eae0407 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
@@ -24,6 +24,7 @@ import org.eclipse.jpt.ui.internal.details.CascadeComposite;
import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
+import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
@@ -114,7 +115,7 @@ public class OrmEclipseLinkOneToManyMapping2_0Composite<T extends EclipseLinkOne
new EclipseLinkPrivateOwnedComposite(this, this.buildPrivateOwnableHolder(), this.addPane(container, groupBoxMargin));
new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), this.addPane(container, groupBoxMargin));
new CascadeComposite(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- new OrderingComposite(this, container);
+ new Ordering2_0Composite(this, container);
}
protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties
index 8b56784f82..d6e442e6d2 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties
@@ -17,5 +17,7 @@ ElementCollectionMapping2_0_linkLabel=element collection
Entity_cacheableLabel=Cacheable
Entity_cacheableWithDefaultLabel=Cacheable ({0})
+OrderingComposite_orderColumn=Order column
+
OrphanRemoval2_0Composite_orphanRemovalLabel=Orphan removal
OrphanRemoval2_0Composite_orphanRemovalLabelDefault=Orphan removal ({0})
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
index a72428bf34..94df6c2c24 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
@@ -78,6 +78,8 @@ public interface JpaHelpContextIds {
public static final String MAPPING_ORDER_BY_NO_ORDERING = PREFIX + "mapping_orderByNoOrdering";
public static final String MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING = PREFIX + "mapping_orderByPrimaryKeyOrdering";
public static final String MAPPING_ORDER_BY_CUSTOM_ORDERING = PREFIX + "mapping_orderByCustomOrdering";
+ public static final String MAPPING_ORDER_COLUMN_ORDERING = PREFIX + "mapping_orderColumnOrdering";
+ public static final String MAPPING_ORDER_COLUMN_ORDERING_COLUMN = PREFIX + "mapping_orderColumnOrderingColumn";
public static final String MAPPING_PRIMARY_KEY_GENERATION = PREFIX + "mapping_primaryKeyGeneration";
public static final String MAPPING_SEQUENCE_GENERATOR = PREFIX + "mapping_sequenceGenerator";
public static final String MAPPING_SEQUENCE_GENERATOR_NAME = PREFIX + "mapping_sequenceGeneratorName";
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractManyToManyMappingComposite.java
index 907cdf9d91..208af11c64 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractManyToManyMappingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractManyToManyMappingComposite.java
@@ -9,12 +9,14 @@
******************************************************************************/
package org.eclipse.jpt.ui.internal.details;
+import org.eclipse.jpt.core.context.AccessHolder;
import org.eclipse.jpt.core.context.Cascade;
import org.eclipse.jpt.core.context.ManyToManyMapping;
import org.eclipse.jpt.core.context.ManyToManyRelationshipReference;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaComposite;
import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
@@ -100,4 +102,13 @@ public abstract class AbstractManyToManyMappingComposite<T extends ManyToManyMap
}
};
}
+
+ protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
+ return new PropertyAspectAdapter<T, AccessHolder>(getSubjectHolder()) {
+ @Override
+ protected AccessHolder buildValue_() {
+ return this.subject.getPersistentAttribute();
+ }
+ };
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractOrderingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractOrderingComposite.java
new file mode 100644
index 0000000000..d1fb3df041
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractOrderingComposite.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 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.ui.internal.details;
+
+import org.eclipse.jpt.core.context.MultiRelationshipMapping;
+import org.eclipse.jpt.core.context.Orderable;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.internal.utility.swt.SWTTools;
+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.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Here the layout of this pane:
+ * <pre>
+ * -----------------------------------------------------------------------------
+ * | - Ordering -------------------------------------------------------------- |
+ * | | | |
+ * | | o None | |
+ * | | | |
+ * | | o Primary Key | |
+ * | | | |
+ * | | o Custom | |
+ * | | ------------------------------------------------------------------- | |
+ * | | | I | | |
+ * | | ------------------------------------------------------------------- | |
+ * | ------------------------------------------------------------------------- |
+ * -----------------------------------------------------------------------------</pre>
+ *
+ * @see MultiRelationshipMapping
+ * @see ManyToManyMappingComposite - A container of this pane
+ * @see OneToManyMappingComposite - A container of this pane
+ *
+ * @version 3.0
+ * @since 1.0
+ */
+public abstract class AbstractOrderingComposite extends FormPane<MultiRelationshipMapping>
+{
+ /**
+ * Creates a new <code>OrderingComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param parent The parent container
+ */
+ protected AbstractOrderingComposite(FormPane<? extends MultiRelationshipMapping> parentPane,
+ Composite parent) {
+
+ super(parentPane, parent);
+ }
+
+ /**
+ * Creates a new <code>OrderingComposite</code>.
+ *
+ * @param subjectHolder The holder of the subject <code>IMultiRelationshipMapping</code>
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create various common widgets
+ */
+ protected AbstractOrderingComposite(PropertyValueModel<? extends MultiRelationshipMapping> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+
+ super(subjectHolder, parent, widgetFactory);
+ }
+
+
+ protected PropertyValueModel<Orderable> buildOrderableHolder() {
+ return new PropertyAspectAdapter<MultiRelationshipMapping, Orderable>(getSubjectHolder()) {
+ @Override
+ protected Orderable buildValue_() {
+ return this.subject.getOrderable();
+ }
+ };
+ }
+
+ protected WritablePropertyValueModel<Boolean> buildNoOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable.NO_ORDERING_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return Boolean.valueOf(this.subject.isNoOrdering());
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setNoOrdering(value.booleanValue());
+ }
+ };
+ }
+
+ protected WritablePropertyValueModel<Boolean> buildPrimaryKeyOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable.PK_ORDERING_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return Boolean.valueOf(this.subject.isPkOrdering());
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setPkOrdering(value.booleanValue());
+ }
+ };
+ }
+
+ protected WritablePropertyValueModel<Boolean> buildCustomOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable.CUSTOM_ORDERING_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return Boolean.valueOf(this.subject.isCustomOrdering());
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setCustomOrdering(value.booleanValue());
+ }
+ };
+ }
+
+ protected WritablePropertyValueModel<String> buildSpecifiedOrderByHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return new PropertyAspectAdapter<Orderable, String>(orderableHolder, Orderable.SPECIFIED_ORDER_BY_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getSpecifiedOrderBy();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ this.subject.setSpecifiedOrderBy(value);
+ }
+ };
+ }
+
+ protected void installCustomTextEnabler(Text text, PropertyValueModel<Orderable> orderableHolder) {
+ PropertyValueModel<Boolean> enabler = buildCustomOrderingHolder(orderableHolder);
+ SWTTools.controlEnabledState(enabler, text);
+ }
+
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/OrderingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/OrderingComposite.java
index eae0caa402..623ba160fd 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/OrderingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/OrderingComposite.java
@@ -10,13 +10,11 @@
package org.eclipse.jpt.ui.internal.details;
import org.eclipse.jpt.core.context.MultiRelationshipMapping;
+import org.eclipse.jpt.core.context.Orderable;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.utility.swt.SWTTools;
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.jpt.utility.model.value.WritablePropertyValueModel;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
@@ -45,7 +43,7 @@ import org.eclipse.swt.widgets.Text;
* @version 3.0
* @since 1.0
*/
-public class OrderingComposite extends FormPane<MultiRelationshipMapping>
+public class OrderingComposite extends AbstractOrderingComposite
{
/**
* Creates a new <code>OrderingComposite</code>.
@@ -75,7 +73,8 @@ public class OrderingComposite extends FormPane<MultiRelationshipMapping>
@Override
protected void initializeLayout(Composite container) {
-
+ PropertyValueModel<Orderable> orderableHolder = buildOrderableHolder();
+
// Order By group
Group orderByGroup = addTitledGroup(
container,
@@ -86,7 +85,7 @@ public class OrderingComposite extends FormPane<MultiRelationshipMapping>
addRadioButton(
addSubPane(orderByGroup, 8),
JptUiDetailsMessages.OrderingComposite_none,
- buildNoOrderingHolder(),
+ buildNoOrderingHolder(orderableHolder),
JpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING
);
@@ -94,7 +93,7 @@ public class OrderingComposite extends FormPane<MultiRelationshipMapping>
addRadioButton(
orderByGroup,
JptUiDetailsMessages.OrderingComposite_primaryKey,
- buildPrimaryKeyOrderingHolder(),
+ buildPrimaryKeyOrderingHolder(orderableHolder),
JpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING
);
@@ -102,78 +101,19 @@ public class OrderingComposite extends FormPane<MultiRelationshipMapping>
addRadioButton(
orderByGroup,
JptUiDetailsMessages.OrderingComposite_custom,
- buildCustomOrderingHolder(),
+ buildCustomOrderingHolder(orderableHolder),
JpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING
);
// Custom Ordering text field
Text customOrderingText = addUnmanagedText(
addSubPane(orderByGroup, 0, 16),
- buildSpecifiedOrderByHolder(),
+ buildSpecifiedOrderByHolder(orderableHolder),
JpaHelpContextIds.MAPPING_ORDER_BY
);
- installCustomTextEnabler(customOrderingText);
- }
-
- private WritablePropertyValueModel<Boolean> buildNoOrderingHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, Boolean>(getSubjectHolder(), MultiRelationshipMapping.NO_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNoOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNoOrdering(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildPrimaryKeyOrderingHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, Boolean>(getSubjectHolder(), MultiRelationshipMapping.PK_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isPkOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setPkOrdering(value.booleanValue());
- }
- };
+ installCustomTextEnabler(customOrderingText, orderableHolder);
}
- private WritablePropertyValueModel<Boolean> buildCustomOrderingHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, Boolean>(getSubjectHolder(), MultiRelationshipMapping.CUSTOM_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isCustomOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setCustomOrdering(value.booleanValue());
- }
- };
- }
-
- protected WritablePropertyValueModel<String> buildSpecifiedOrderByHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, String>(getSubjectHolder(), MultiRelationshipMapping.SPECIFIED_ORDER_BY_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedOrderBy();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setSpecifiedOrderBy(value);
- }
- };
- }
-
- private void installCustomTextEnabler(Text text) {
- SWTTools.controlEnabledState(buildCustomOrderingHolder(), text);
- }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java
index db97de3122..78cc31e99b 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java
@@ -55,7 +55,7 @@ import org.eclipse.swt.widgets.Composite;
* -----------------------------------------------------------------------------</pre>
*
* @see BasicMapping
- * @see ColumnComposite
+ * @see OrderColumnComposite
* @see EnumTypeComposite
* @see FetchTypeComposite
* @see LobComposite
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java
index 87136ef0d0..3de5bef949 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java
@@ -52,7 +52,7 @@ import org.eclipse.swt.widgets.Composite;
* -----------------------------------------------------------------------------</pre>
*
* @see BasicMapping
- * @see ColumnComposite
+ * @see OrderColumnComposite
* @see EnumTypeComposite
* @see FetchTypeComposite
* @see LobComposite
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java
index f044769019..90fb68b2ca 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java
@@ -26,6 +26,8 @@ public class JptUiDetailsMessages2_0 {
public static String Entity_cacheableLabel;
public static String Entity_cacheableWithDefaultLabel;
+ public static String OrderingComposite_orderColumn;
+
public static String OrphanRemoval2_0Composite_orphanRemovalLabel;
public static String OrphanRemoval2_0Composite_orphanRemovalLabelDefault;
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java
new file mode 100644
index 0000000000..b8792e250b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java
@@ -0,0 +1,373 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 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.ui.internal.jpa2.details;
+
+import java.util.Collection;
+import org.eclipse.jpt.core.context.BaseColumn;
+import org.eclipse.jpt.core.context.NamedColumn;
+import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
+import org.eclipse.jpt.db.Table;
+import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
+import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
+import org.eclipse.jpt.ui.internal.details.db.ColumnCombo;
+import org.eclipse.jpt.ui.internal.util.PaneEnabler;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
+import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Here the layout of this pane:
+ * <pre>
+ * -----------------------------------------------------------------------------
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | ColumnCombo | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | |
+ * | > Details |
+ * | |
+ * | x Insertable |
+ * | |
+ * | x Updatable |
+ * | |
+ * | x Nullable |
+ * | |
+ * | ---------------------------------------------------- |
+ * | Column Definition: | I | |
+ * | ---------------------------------------------------- |
+ * -----------------------------------------------------------------------------</pre>
+ * *
+ * @version 3.0
+ * @since 3.0
+ */
+public class OrderColumnComposite extends FormPane<OrderColumn2_0> {
+
+ /**
+ * Creates a new <code>ColumnComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param subjectHolder The holder of the subject <code>IColumn</code>
+ * @param parent The parent container
+ */
+ public OrderColumnComposite(FormPane<?> parentPane,
+ PropertyValueModel<? extends OrderColumn2_0> subjectHolder,
+ Composite parent) {
+
+ super(parentPane, subjectHolder, parent, false);
+ }
+
+ /**
+ * Creates a new <code>ColumnComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param subjectHolder The holder of the subject <code>IColumn</code>
+ * @param parent The parent container
+ * @param automaticallyAlignWidgets <code>true</code> to make the widgets
+ * this pane aligned with the widgets of the given parent controller;
+ * <code>false</code> to not align them
+ */
+ public OrderColumnComposite(FormPane<?> parentPane,
+ PropertyValueModel<? extends OrderColumn2_0> subjectHolder,
+ Composite parent,
+ boolean automaticallyAlignWidgets) {
+
+ super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
+ }
+
+ /**
+ * Creates a new <code>ColumnComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param subjectHolder The holder of the subject <code>IColumn</code>
+ * @param parent The parent container
+ * @param automaticallyAlignWidgets <code>true</code> to make the widgets
+ * this pane aligned with the widgets of the given parent controller;
+ * <code>false</code> to not align them
+ */
+ public OrderColumnComposite(FormPane<?> parentPane,
+ PropertyValueModel<? extends OrderColumn2_0> subjectHolder,
+ Composite parent,
+ boolean automaticallyAlignWidgets,
+ boolean parentManagePane) {
+
+ super(parentPane, subjectHolder, parent, automaticallyAlignWidgets, parentManagePane);
+ }
+
+ private ColumnCombo<OrderColumn2_0> addColumnCombo(Composite container) {
+
+ return new ColumnCombo<OrderColumn2_0>(this, container) {
+
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(NamedColumn.DEFAULT_NAME_PROPERTY);
+ propertyNames.add(NamedColumn.SPECIFIED_NAME_PROPERTY);
+ }
+
+ @Override
+ protected String getDefaultValue() {
+ return getSubject().getDefaultName();
+ }
+
+ @Override
+ protected void setValue(String value) {
+ getSubject().setSpecifiedName(value);
+ }
+
+ @Override
+ protected Table getDbTable_() {
+ return getSubject().getDbTable();
+ }
+
+ @Override
+ protected String getValue() {
+ return getSubject().getSpecifiedName();
+ }
+ @Override
+ public String toString() {
+ return "OrderColumnComposite.columnCombo"; //$NON-NLS-1$
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildColumnDefinitionHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, String>(getSubjectHolder(), NamedColumn.COLUMN_DEFINITION_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getColumnDefinition();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setColumnDefinition(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Boolean> buildInsertableHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(getSubjectHolder(), BaseColumn.SPECIFIED_INSERTABLE_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getSpecifiedInsertable();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setSpecifiedInsertable(value);
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildInsertableStringHolder() {
+ return new TransformationPropertyValueModel<Boolean, String>(buildDefaultInsertableHolder()) {
+ @Override
+ protected String transform(Boolean value) {
+ if (value != null) {
+ String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
+ return NLS.bind(JptUiDetailsMessages.ColumnComposite_insertableWithDefault, defaultStringValue);
+ }
+ return JptUiDetailsMessages.ColumnComposite_insertable;
+ }
+ };
+ }
+
+ private PropertyValueModel<Boolean> buildDefaultInsertableHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
+ getSubjectHolder(),
+ BaseColumn.SPECIFIED_INSERTABLE_PROPERTY,
+ BaseColumn.DEFAULT_INSERTABLE_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ if (this.subject.getSpecifiedInsertable() != null) {
+ return null;
+ }
+ return Boolean.valueOf(this.subject.isDefaultInsertable());
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<Boolean> buildNullableHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
+ getSubjectHolder(),
+ BaseColumn.SPECIFIED_NULLABLE_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getSpecifiedNullable();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setSpecifiedNullable(value);
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildNullableStringHolder() {
+ return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNullableHolder()) {
+ @Override
+ protected String transform(Boolean value) {
+ if (value != null) {
+ String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
+ return NLS.bind(JptUiDetailsMessages.ColumnComposite_nullableWithDefault, defaultStringValue);
+ }
+ return JptUiDetailsMessages.ColumnComposite_nullable;
+ }
+ };
+ }
+
+ private PropertyValueModel<Boolean> buildDefaultNullableHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
+ getSubjectHolder(),
+ BaseColumn.SPECIFIED_NULLABLE_PROPERTY,
+ BaseColumn.DEFAULT_NULLABLE_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ if (this.subject.getSpecifiedNullable() != null) {
+ return null;
+ }
+ return Boolean.valueOf(this.subject.isDefaultNullable());
+ }
+ };
+ }
+
+
+ private WritablePropertyValueModel<Boolean> buildUpdatableHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
+ getSubjectHolder(),
+ BaseColumn.DEFAULT_UPDATABLE_PROPERTY,
+ BaseColumn.SPECIFIED_UPDATABLE_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getSpecifiedUpdatable();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setSpecifiedUpdatable(value);
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildUpdatableStringHolder() {
+
+ return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUpdatableHolder()) {
+
+ @Override
+ protected String transform(Boolean value) {
+ if (value != null) {
+ String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
+ return NLS.bind(JptUiDetailsMessages.ColumnComposite_updatableWithDefault, defaultStringValue);
+ }
+ return JptUiDetailsMessages.ColumnComposite_updatable;
+ }
+ };
+ }
+
+ private PropertyValueModel<Boolean> buildDefaultUpdatableHolder() {
+ return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
+ getSubjectHolder(),
+ BaseColumn.SPECIFIED_UPDATABLE_PROPERTY,
+ BaseColumn.DEFAULT_UPDATABLE_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ if (this.subject.getSpecifiedUpdatable() != null) {
+ return null;
+ }
+ return Boolean.valueOf(this.subject.isDefaultUpdatable());
+ }
+ };
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ // Column widgets
+ addLabeledComposite(
+ container,
+ JptUiDetailsMessages.ColumnComposite_name,
+ addColumnCombo(container),
+ JpaHelpContextIds.MAPPING_ORDER_COLUMN_ORDERING_COLUMN
+ );
+
+ // Details sub-pane
+ container = addCollapsableSubSection(
+ container,
+ JptUiDetailsMessages.ColumnComposite_details,
+ new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
+ );
+
+ new DetailsComposite(this, getSubjectHolder(), addSubPane(container, 0, 16));
+ }
+
+ protected void installPaneEnabler(PropertyValueModel<Boolean> booleanHolder) {
+ new PaneEnabler(booleanHolder, this);
+ }
+
+ protected class DetailsComposite extends FormPane<OrderColumn2_0> {
+
+ public DetailsComposite(FormPane<?> parentPane,
+ PropertyValueModel<? extends OrderColumn2_0> subjectHolder,
+ Composite parent) {
+
+ super(parentPane, subjectHolder, parent, false);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ // Insertable tri-state check box
+ addTriStateCheckBoxWithDefault(
+ addSubPane(container, 4),
+ JptUiDetailsMessages.ColumnComposite_insertable,
+ buildInsertableHolder(),
+ buildInsertableStringHolder(),
+ JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE
+ );
+
+ // Updatable tri-state check box
+ addTriStateCheckBoxWithDefault(
+ container,
+ JptUiDetailsMessages.ColumnComposite_updatable,
+ buildUpdatableHolder(),
+ buildUpdatableStringHolder(),
+ JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE
+ );
+
+ // Nullable tri-state check box
+ addTriStateCheckBoxWithDefault(
+ container,
+ JptUiDetailsMessages.ColumnComposite_nullable,
+ buildNullableHolder(),
+ buildNullableStringHolder(),
+ JpaHelpContextIds.MAPPING_COLUMN_NULLABLE
+ );
+
+ // Column Definition widgets
+ addLabeledText(
+ container,
+ JptUiDetailsMessages.ColumnComposite_columnDefinition,
+ buildColumnDefinitionHolder()
+ );
+ }
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java
new file mode 100644
index 0000000000..9efaea1037
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * 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.ui.internal.jpa2.details;
+
+import org.eclipse.jpt.core.context.MultiRelationshipMapping;
+import org.eclipse.jpt.core.context.Orderable;
+import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
+import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
+import org.eclipse.jpt.ui.internal.details.AbstractOrderingComposite;
+import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
+import org.eclipse.jpt.ui.internal.details.ManyToManyMappingComposite;
+import org.eclipse.jpt.ui.internal.details.OneToManyMappingComposite;
+import org.eclipse.jpt.ui.internal.util.PaneEnabler;
+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.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Here the layout of this pane:
+ * <pre>
+ * -----------------------------------------------------------------------------
+ * | - Ordering -------------------------------------------------------------- |
+ * | | | |
+ * | | o None | |
+ * | | | |
+ * | | o Primary Key | |
+ * | | | |
+ * | | o Custom | |
+ * | | ------------------------------------------------------------------- | |
+ * | | | I | | |
+ * | | ------------------------------------------------------------------- | |
+ * | ------------------------------------------------------------------------- |
+ * -----------------------------------------------------------------------------</pre>
+ *
+ * @see MultiRelationshipMapping
+ * @see ManyToManyMappingComposite - A container of this pane
+ * @see OneToManyMappingComposite - A container of this pane
+ *
+ * @version 3.0
+ * @since 1.0
+ */
+public class Ordering2_0Composite extends AbstractOrderingComposite
+{
+ /**
+ * Creates a new <code>OrderingComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param parent The parent container
+ */
+ public Ordering2_0Composite(FormPane<? extends MultiRelationshipMapping> parentPane,
+ Composite parent) {
+
+ super(parentPane, parent);
+ }
+
+ /**
+ * Creates a new <code>OrderingComposite</code>.
+ *
+ * @param subjectHolder The holder of the subject <code>IMultiRelationshipMapping</code>
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create various common widgets
+ */
+ public Ordering2_0Composite(PropertyValueModel<? extends MultiRelationshipMapping> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+
+ super(subjectHolder, parent, widgetFactory);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ PropertyValueModel<Orderable> orderableHolder = buildOrderableHolder();
+
+ // Ordering group
+ Group orderingGroup = addTitledGroup(
+ container,
+ JptUiDetailsMessages.OrderingComposite_orderingGroup,
+ JpaHelpContextIds.MAPPING_ORDER_BY);
+
+ // No Ordering radio button
+ addRadioButton(
+ addSubPane(orderingGroup, 8),
+ JptUiDetailsMessages.OrderingComposite_none,
+ buildNoOrderingHolder(orderableHolder),
+ JpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING
+ );
+
+ // Order by Primary Key radio button
+ addRadioButton(
+ orderingGroup,
+ JptUiDetailsMessages.OrderingComposite_primaryKey,
+ buildPrimaryKeyOrderingHolder(orderableHolder),
+ JpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING
+ );
+
+ // Custom Ordering radio button
+ addRadioButton(
+ orderingGroup,
+ JptUiDetailsMessages.OrderingComposite_custom,
+ buildCustomOrderingHolder(orderableHolder),
+ JpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING
+ );
+
+ // Custom Ordering text field
+ Text customOrderingText = addUnmanagedText(
+ addSubPane(orderingGroup, 0, 16),
+ buildSpecifiedOrderByHolder(orderableHolder),
+ JpaHelpContextIds.MAPPING_ORDER_BY
+ );
+
+ installCustomTextEnabler(customOrderingText, orderableHolder);
+
+
+ // Order Column Ordering radio button
+ addRadioButton(
+ orderingGroup,
+ JptUiDetailsMessages2_0.OrderingComposite_orderColumn,
+ buildOrderColumnOrderingHolder(orderableHolder),
+ JpaHelpContextIds.MAPPING_ORDER_COLUMN_ORDERING
+ );
+
+ OrderColumnComposite orderColumnComposite = new OrderColumnComposite(
+ this,
+ buildOrderColumnHolder(orderableHolder),
+ addSubPane(orderingGroup, 0, 16));
+
+ installOrderColumnCompositeEnabler(orderableHolder, orderColumnComposite);
+ }
+
+ protected void installOrderColumnCompositeEnabler(PropertyValueModel<Orderable> orderableHolder, OrderColumnComposite pane) {
+ new PaneEnabler(buildPaneEnablerHolder(orderableHolder), pane);
+ }
+
+ private PropertyValueModel<Boolean> buildPaneEnablerHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return buildOrderColumnOrderingHolder(orderableHolder);
+ }
+
+
+ protected WritablePropertyValueModel<Boolean> buildOrderColumnOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable2_0.ORDER_COLUMN_ORDERING_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return Boolean.valueOf(((Orderable2_0) this.subject).isOrderColumnOrdering());
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ ((Orderable2_0) this.subject).setOrderColumnOrdering(value.booleanValue());
+ }
+ };
+ }
+
+ protected PropertyValueModel<OrderColumn2_0> buildOrderColumnHolder(PropertyValueModel<Orderable> orderableHolder) {
+ return new PropertyAspectAdapter<Orderable, OrderColumn2_0>(orderableHolder) {
+ @Override
+ protected OrderColumn2_0 buildValue_() {
+ return ((Orderable2_0) this.subject).getOrderColumn();
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java
index d5ef33af70..f55bb88976 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java
@@ -13,6 +13,7 @@ import org.eclipse.jpt.core.context.java.JavaEmbeddable;
import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
import org.eclipse.jpt.core.context.java.JavaEntity;
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.JavaMappedSuperclass;
import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
@@ -79,6 +80,14 @@ public class Generic2_0JavaUiFactory
}
@Override
+ public JpaComposite createJavaManyToManyMappingComposite(
+ PropertyValueModel<JavaManyToManyMapping> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+ return new JavaManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
+ }
+
+ @Override
public JpaComposite createJavaManyToOneMappingComposite(
PropertyValueModel<JavaManyToOneMapping> subjectHolder,
Composite parent,
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java
new file mode 100644
index 0000000000..104d6fb44f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 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.ui.internal.jpa2.details.java;
+
+import org.eclipse.jpt.core.context.ManyToManyMapping;
+import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.internal.details.AbstractManyToManyMappingComposite;
+import org.eclipse.jpt.ui.internal.details.CascadeComposite;
+import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
+import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
+import org.eclipse.jpt.ui.internal.details.OrderingComposite;
+import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
+import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Here the layout of this pane:
+ * <pre>
+ * -----------------------------------------------------------------------------
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | TargetEntityComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | JoiningStrategyComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | FetchTypeComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | CascadeComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * | ------------------------------------------------------------------------- |
+ * | | | |
+ * | | OrderingComposite | |
+ * | | | |
+ * | ------------------------------------------------------------------------- |
+ * -----------------------------------------------------------------------------</pre>
+ *
+ * @see {@link ManyToManyMapping}
+ * @see {@link TargetEntityComposite}
+ * @see {@link ManyToManyJoiningStrategyPane}
+ * @see {@link FetchTypeComposite}
+ * @see {@link CascadeComposite}
+ * @see {@link OrderingComposite}
+ *
+ * @version 3.0
+ * @since 1.0
+ */
+public class JavaManyToManyMapping2_0Composite
+ extends AbstractManyToManyMappingComposite<JavaManyToManyMapping>
+{
+ /**
+ * Creates a new <code>ManyToManyMappingComposite</code>.
+ *
+ * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create various common widgets
+ */
+ public JavaManyToManyMapping2_0Composite(PropertyValueModel<? extends JavaManyToManyMapping> subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory) {
+
+ super(subjectHolder, parent, widgetFactory);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ int groupBoxMargin = getGroupBoxMargin();
+
+ new TargetEntityComposite(this, addPane(container, groupBoxMargin));
+ new ManyToManyJoiningStrategyPane(this, buildJoiningHolder(), container);
+ new FetchTypeComposite(this, addPane(container, groupBoxMargin));
+ new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
+ new Ordering2_0Composite(this, container);
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java
index 7debddce33..93a4a47e82 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java
@@ -19,6 +19,7 @@ import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.OneToManyJoiningStrategyPane;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
+import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
@@ -88,7 +89,7 @@ public class JavaOneToManyMapping2_0Composite<T extends JavaOneToManyMapping2_0>
new FetchTypeComposite(this, this.addPane(container, groupBoxMargin));
new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), this.addPane(container, groupBoxMargin));
new CascadeComposite(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- new OrderingComposite(this, container);
+ new Ordering2_0Composite(this, container);
}
protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java
index d6e5be356c..9ac93dc3f8 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.ui.internal.jpa2.details.orm;
-import org.eclipse.jpt.core.context.AccessHolder;
import org.eclipse.jpt.core.context.ManyToManyMapping;
import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
import org.eclipse.jpt.ui.WidgetFactory;
@@ -20,7 +19,7 @@ import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
@@ -91,15 +90,6 @@ public class OrmManyToManyMapping2_0Composite extends AbstractManyToManyMappingC
new AccessTypeComposite(this, buildAccessHolderHolder(), addPane(container, groupBoxMargin));
new FetchTypeComposite(this, addPane(container, groupBoxMargin));
new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- new OrderingComposite(this, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OrmManyToManyMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
+ new Ordering2_0Composite(this, container);
}
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java
index 7b9f00548b..53c217072e 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java
@@ -23,6 +23,7 @@ import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
import org.eclipse.jpt.ui.internal.details.OneToManyJoiningStrategyPane;
import org.eclipse.jpt.ui.internal.details.OrderingComposite;
import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
+import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
@@ -98,7 +99,7 @@ public class OrmOneToManyMapping2_0Composite<T extends OrmOneToManyMapping2_0>
new FetchTypeComposite(this, this.addPane(container, groupBoxMargin));
new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), this.addPane(container, groupBoxMargin));
new CascadeComposite(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- new OrderingComposite(this, container);
+ new Ordering2_0Composite(this, container);
}
protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java
index ffdd688b1c..66ab5a67ae 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java
@@ -255,7 +255,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -277,7 +277,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -298,7 +298,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -320,7 +320,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -342,7 +342,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -364,7 +364,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -386,7 +386,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -408,7 +408,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -430,7 +430,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -452,7 +452,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.setSpecifiedOrderBy("asdf");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(manyToManyMapping.isDefault());
@@ -838,19 +838,19 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(manyToManyMapping.getSpecifiedOrderBy());
+ assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertEquals("newOrderBy", manyToManyMapping.getSpecifiedOrderBy());
+ assertEquals("newOrderBy", manyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertEquals("newOrderBy", orderBy.getValue());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedOrderBy());
+ assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -864,18 +864,18 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(manyToManyMapping.getSpecifiedOrderBy());
+ assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set mappedBy in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", manyToManyMapping.getSpecifiedOrderBy());
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
+ assertEquals("newOrderBy", manyToManyMapping.getOrderable().getSpecifiedOrderBy());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
assertEquals("newOrderBy", orderBy.getValue());
//set mappedBy to null in the context model
- manyToManyMapping.setSpecifiedOrderBy(null);
- assertNull(manyToManyMapping.getSpecifiedOrderBy());
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -889,20 +889,20 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertTrue(manyToManyMapping.isNoOrdering());
+ assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isNoOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isNoOrdering());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertFalse(manyToManyMapping.isNoOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isNoOrdering());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(manyToManyMapping.isNoOrdering());
+ assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -916,7 +916,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertTrue(manyToManyMapping.isNoOrdering());
+ assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
// manyToManyMapping.setNoOrdering(false); //this does nothing
@@ -942,20 +942,20 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(manyToManyMapping.isPkOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(manyToManyMapping.isPkOrdering());
+ assertTrue(manyToManyMapping.getOrderable().isPkOrdering());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertFalse(manyToManyMapping.isPkOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isPkOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -969,20 +969,20 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(manyToManyMapping.isCustomOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isCustomOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertTrue(manyToManyMapping.isCustomOrdering());
+ assertTrue(manyToManyMapping.getOrderable().isCustomOrdering());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isCustomOrdering());
+ assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java
index 3242e14eb6..fc03be6fff 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java
@@ -256,7 +256,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -278,7 +278,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -299,7 +299,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -321,7 +321,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -343,7 +343,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -365,7 +365,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -387,7 +387,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -409,7 +409,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -431,7 +431,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -453,7 +453,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedOrderBy("asdf");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO");
assertFalse(oneToManyMapping.isDefault());
@@ -842,19 +842,19 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(oneToManyMapping.getSpecifiedOrderBy());
+ assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertEquals("newOrderBy", oneToManyMapping.getSpecifiedOrderBy());
+ assertEquals("newOrderBy", oneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertEquals("newOrderBy", orderBy.getValue());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedOrderBy());
+ assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -868,18 +868,18 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(oneToManyMapping.getSpecifiedOrderBy());
+ assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set mappedBy in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", oneToManyMapping.getSpecifiedOrderBy());
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
+ assertEquals("newOrderBy", oneToManyMapping.getOrderable().getSpecifiedOrderBy());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
assertEquals("newOrderBy", orderBy.getValue());
//set mappedBy to null in the context model
- oneToManyMapping.setSpecifiedOrderBy(null);
- assertNull(oneToManyMapping.getSpecifiedOrderBy());
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -893,20 +893,20 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertTrue(oneToManyMapping.isNoOrdering());
+ assertTrue(oneToManyMapping.getOrderable().isNoOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isNoOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isNoOrdering());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertFalse(oneToManyMapping.isNoOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isNoOrdering());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(oneToManyMapping.isNoOrdering());
+ assertTrue(oneToManyMapping.getOrderable().isNoOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -920,20 +920,20 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(oneToManyMapping.isPkOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertTrue(oneToManyMapping.isPkOrdering());
+ assertTrue(oneToManyMapping.getOrderable().isPkOrdering());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertFalse(oneToManyMapping.isPkOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isPkOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
@@ -947,20 +947,20 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase
JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertFalse(oneToManyMapping.isCustomOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
//set orderBy in the resource model, verify context model updated
attributeResource.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isCustomOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
OrderByAnnotation orderBy = (OrderByAnnotation) attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
orderBy.setValue("newOrderBy");
- assertTrue(oneToManyMapping.isCustomOrdering());
+ assertTrue(oneToManyMapping.getOrderable().isCustomOrdering());
//set orderBy to null in the resource model
attributeResource.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isCustomOrdering());
+ assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
assertNull(attributeResource.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
index c2d38d401a..457fa85876 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
@@ -365,17 +365,17 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(ormManyToManyMapping.getSpecifiedOrderBy());
+ assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(manyToMany.getOrderBy());
//set orderBy in the resource model, verify context model updated
manyToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getSpecifiedOrderBy());
+ assertEquals("newOrderBy", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertEquals("newOrderBy", manyToMany.getOrderBy());
//set orderBy to null in the resource model
manyToMany.setOrderBy(null);
- assertNull(ormManyToManyMapping.getSpecifiedOrderBy());
+ assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(manyToMany.getOrderBy());
}
@@ -385,17 +385,17 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(ormManyToManyMapping.getSpecifiedOrderBy());
+ assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(manyToMany.getOrderBy());
//set mappedBy in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getSpecifiedOrderBy());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
+ assertEquals("newOrderBy", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertEquals("newOrderBy", manyToMany.getOrderBy());
//set mappedBy to null in the context model
- ormManyToManyMapping.setSpecifiedOrderBy(null);
- assertNull(ormManyToManyMapping.getSpecifiedOrderBy());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(manyToMany.getOrderBy());
}
@@ -404,13 +404,13 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- assertTrue(ormManyToManyMapping.isNoOrdering());
+ assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- ormManyToManyMapping.setSpecifiedOrderBy("foo");
- assertFalse(ormManyToManyMapping.isNoOrdering());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
+ assertFalse(ormManyToManyMapping.getOrderable().isNoOrdering());
- ormManyToManyMapping.setSpecifiedOrderBy(null);
- assertTrue(ormManyToManyMapping.isNoOrdering());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
}
public void testSetNoOrdering() throws Exception {
@@ -418,14 +418,14 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- assertTrue(ormManyToManyMapping.isNoOrdering());
+ assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- ormManyToManyMapping.setSpecifiedOrderBy("foo");
- assertFalse(ormManyToManyMapping.isNoOrdering());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
+ assertFalse(ormManyToManyMapping.getOrderable().isNoOrdering());
- ormManyToManyMapping.setNoOrdering(true);
- assertTrue(ormManyToManyMapping.isNoOrdering());
- assertNull(ormManyToManyMapping.getSpecifiedOrderBy());
+ ormManyToManyMapping.getOrderable().setNoOrdering(true);
+ assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
+ assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
}
//TODO
// public boolean isOrderByPk() {
@@ -441,13 +441,13 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping");
OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(ormManyToManyMapping.isCustomOrdering());
+ assertFalse(ormManyToManyMapping.getOrderable().isCustomOrdering());
- ormManyToManyMapping.setSpecifiedOrderBy("foo");
- assertTrue(ormManyToManyMapping.isCustomOrdering());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
+ assertTrue(ormManyToManyMapping.getOrderable().isCustomOrdering());
- ormManyToManyMapping.setSpecifiedOrderBy(null);
- assertFalse(ormManyToManyMapping.isCustomOrdering());
+ ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertFalse(ormManyToManyMapping.getOrderable().isCustomOrdering());
}
public void testManyToManyMorphToIdMapping() throws Exception {
@@ -458,7 +458,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
assertFalse(manyToManyMapping.isDefault());
@@ -477,7 +477,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
assertFalse(manyToManyMapping.isDefault());
@@ -496,7 +496,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
assertFalse(manyToManyMapping.isDefault());
@@ -515,7 +515,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
assertFalse(manyToManyMapping.isDefault());
@@ -534,7 +534,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
assertFalse(manyToManyMapping.isDefault());
@@ -553,7 +553,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
manyToManyMapping.getCascade().setAll(true);
@@ -586,7 +586,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
manyToManyMapping.getCascade().setAll(true);
manyToManyMapping.getCascade().setMerge(true);
@@ -630,7 +630,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
manyToManyMapping.getCascade().setAll(true);
manyToManyMapping.getCascade().setMerge(true);
@@ -661,7 +661,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase
assertFalse(manyToManyMapping.isDefault());
manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.setSpecifiedOrderBy("customOrder");
+ manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
manyToManyMapping.setSpecifiedMapKey("mapKey");
manyToManyMapping.getCascade().setAll(true);
manyToManyMapping.getCascade().setMerge(true);
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
index daba440ef8..c25fd9d38d 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
@@ -362,17 +362,17 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
- assertNull(ormOneToManyMapping.getSpecifiedOrderBy());
+ assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(oneToMany.getOrderBy());
//set orderBy in the resource model, verify context model updated
oneToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getSpecifiedOrderBy());
+ assertEquals("newOrderBy", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertEquals("newOrderBy", oneToMany.getOrderBy());
//set orderBy to null in the resource model
oneToMany.setOrderBy(null);
- assertNull(ormOneToManyMapping.getSpecifiedOrderBy());
+ assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(oneToMany.getOrderBy());
}
@@ -382,17 +382,17 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
- assertNull(ormOneToManyMapping.getSpecifiedOrderBy());
+ assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(oneToMany.getOrderBy());
//set mappedBy in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getSpecifiedOrderBy());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
+ assertEquals("newOrderBy", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertEquals("newOrderBy", oneToMany.getOrderBy());
//set mappedBy to null in the context model
- ormOneToManyMapping.setSpecifiedOrderBy(null);
- assertNull(ormOneToManyMapping.getSpecifiedOrderBy());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
assertNull(oneToMany.getOrderBy());
}
@@ -401,13 +401,13 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- assertTrue(ormOneToManyMapping.isNoOrdering());
+ assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- ormOneToManyMapping.setSpecifiedOrderBy("foo");
- assertFalse(ormOneToManyMapping.isNoOrdering());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
+ assertFalse(ormOneToManyMapping.getOrderable().isNoOrdering());
- ormOneToManyMapping.setSpecifiedOrderBy(null);
- assertTrue(ormOneToManyMapping.isNoOrdering());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
}
public void testSetNoOrdering() throws Exception {
@@ -415,14 +415,14 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- assertTrue(ormOneToManyMapping.isNoOrdering());
+ assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- ormOneToManyMapping.setSpecifiedOrderBy("foo");
- assertFalse(ormOneToManyMapping.isNoOrdering());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
+ assertFalse(ormOneToManyMapping.getOrderable().isNoOrdering());
- ormOneToManyMapping.setNoOrdering(true);
- assertTrue(ormOneToManyMapping.isNoOrdering());
- assertNull(ormOneToManyMapping.getSpecifiedOrderBy());
+ ormOneToManyMapping.getOrderable().setNoOrdering(true);
+ assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
+ assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
}
//TODO
// public boolean isOrderByPk() {
@@ -438,13 +438,13 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping");
OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(ormOneToManyMapping.isCustomOrdering());
+ assertFalse(ormOneToManyMapping.getOrderable().isCustomOrdering());
- ormOneToManyMapping.setSpecifiedOrderBy("foo");
- assertTrue(ormOneToManyMapping.isCustomOrdering());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
+ assertTrue(ormOneToManyMapping.getOrderable().isCustomOrdering());
- ormOneToManyMapping.setSpecifiedOrderBy(null);
- assertFalse(ormOneToManyMapping.isCustomOrdering());
+ ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
+ assertFalse(ormOneToManyMapping.getOrderable().isCustomOrdering());
}
public void testOneToManyMorphToIdMapping() throws Exception {
@@ -455,7 +455,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
assertFalse(oneToManyMapping.isDefault());
@@ -475,7 +475,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
JoinColumn joinColumn = oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedJoinColumn(0);
@@ -501,7 +501,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
assertFalse(oneToManyMapping.isDefault());
@@ -521,7 +521,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
JoinColumn joinColumn = oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedJoinColumn(0);
@@ -547,7 +547,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
assertFalse(oneToManyMapping.isDefault());
@@ -567,7 +567,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
oneToManyMapping.getCascade().setAll(true);
@@ -600,7 +600,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getCascade().setAll(true);
oneToManyMapping.getCascade().setMerge(true);
@@ -644,7 +644,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
oneToManyMapping.getCascade().setAll(true);
@@ -676,7 +676,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase
assertFalse(oneToManyMapping.isDefault());
oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.setSpecifiedOrderBy("customOrder");
+ oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
oneToManyMapping.setSpecifiedMapKey("mapKey");
oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy");
oneToManyMapping.getCascade().setAll(true);

Back to the top