Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2009-09-02 06:25:34 +0000
committerpfullbright2009-09-02 06:25:34 +0000
commit423000fb744bc2279a01d7a339575042f4cfe2b3 (patch)
tree437bec00b4871b6737b8319a3f277f09837e2d44
parent6a5266cf0a8dc0be00b285d364474a3a4451683f (diff)
downloadwebtools.dali-423000fb744bc2279a01d7a339575042f4cfe2b3.tar.gz
webtools.dali-423000fb744bc2279a01d7a339575042f4cfe2b3.tar.xz
webtools.dali-423000fb744bc2279a01d7a339575042f4cfe2b3.zip
changes to DerivedId interface, java hierarchy
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedId2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedId2_0.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java6
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java22
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java22
8 files changed, 51 insertions, 47 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedId2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedId2_0.java
index 444e0d2b85..0d96c376ca 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedId2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedId2_0.java
@@ -23,7 +23,7 @@ public class GenericJavaDerivedId2_0
extends AbstractJavaJpaContextNode
implements JavaDerivedId2_0
{
- protected boolean derivedId;
+ protected boolean value;
public GenericJavaDerivedId2_0(JavaSingleRelationshipMapping2_0 parent) {
@@ -40,30 +40,30 @@ public class GenericJavaDerivedId2_0
return getParent().getPersistentAttribute().getResourcePersistentAttribute();
}
- public boolean isDerivedId() {
- return this.derivedId;
+ public boolean getValue() {
+ return this.value;
}
- public void setDerivedId(boolean newDerivedId) {
- if (this.derivedId == newDerivedId) {
+ public void setValue(boolean newValue) {
+ if (this.value == newValue) {
return;
}
- boolean oldDerivedId = this.derivedId;
- this.derivedId = newDerivedId;
+ boolean oldValue = this.value;
+ this.value = newValue;
- if (newDerivedId) {
+ if (newValue) {
addIdAnnotation();
}
else {
removeIdAnnotation();
}
- firePropertyChanged(DERIVED_ID_PROPERTY, oldDerivedId, newDerivedId);
+ firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
}
- protected void setDerivedId_(boolean newDerivedId) {
- boolean oldDerivedId = this.derivedId;
- this.derivedId = newDerivedId;
- firePropertyChanged(DERIVED_ID_PROPERTY, oldDerivedId, newDerivedId);
+ protected void setValue_(boolean newValue) {
+ boolean oldValue = this.value;
+ this.value = newValue;
+ firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
}
protected boolean getResourceDerivedId() {
@@ -83,11 +83,11 @@ public class GenericJavaDerivedId2_0
}
public void initialize() {
- this.derivedId = getResourceDerivedId();
+ this.value = getResourceDerivedId();
}
public void update() {
- this.setDerivedId_(getResourceDerivedId());
+ this.setValue_(getResourceDerivedId());
}
public TextRange getValidationTextRange(CompilationUnit astRoot) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java
index 5e450fdd32..8a7caaefcd 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java
@@ -11,11 +11,9 @@
package org.eclipse.jpt.core.internal.jpa2.context.java;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneMapping2_0;
public class GenericJavaManyToOneMapping2_0
extends AbstractJavaManyToOneMapping2_0
- implements ManyToOneMapping2_0
{
public GenericJavaManyToOneMapping2_0(JavaPersistentAttribute parent) {
super(parent);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java
index b14c6edee7..0652596424 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java
@@ -11,11 +11,9 @@
package org.eclipse.jpt.core.internal.jpa2.context.java;
import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
public class GenericJavaOneToOneMapping2_0
extends AbstractJavaOneToOneMapping2_0
- implements OneToOneMapping2_0
{
public GenericJavaOneToOneMapping2_0(JavaPersistentAttribute parent) {
super(parent);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedId2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedId2_0.java
index 83406099a7..489b7c11a2 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedId2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedId2_0.java
@@ -26,17 +26,17 @@ public interface DerivedId2_0
extends JpaContextNode
{
/**
- * String associated with changes to the derived id property of this object
+ * String associated with changes to the value property of this object
*/
- public static final String DERIVED_ID_PROPERTY = "derivedId"; //$NON-NLS-1$
+ public static final String VALUE_PROPERTY = "value"; //$NON-NLS-1$
/**
* Return whether this object uses a derived id
*/
- boolean isDerivedId();
+ boolean getValue();
/**
* Set whether this object uses a derived id
*/
- void setDerivedId(boolean newValue);
+ void setValue(boolean newValue);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java
index e028c94f1e..5d6e716b26 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java
@@ -11,6 +11,7 @@
package org.eclipse.jpt.core.jpa2.context.java;
import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
+import org.eclipse.jpt.core.jpa2.context.ManyToOneMapping2_0;
/**
* Provisional API: This interface is part of an interim API that is still
@@ -18,7 +19,10 @@ import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
* stability. It is available at this early stage to solicit feedback from
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
*/
public interface JavaManyToOneMapping2_0
- extends JavaManyToOneMapping, JavaSingleRelationshipMapping2_0
+ extends JavaManyToOneMapping, ManyToOneMapping2_0, JavaSingleRelationshipMapping2_0
{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java
index 9231347811..7955d64416 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java
@@ -11,6 +11,7 @@
package org.eclipse.jpt.core.jpa2.context.java;
import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
+import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
/**
* Provisional API: This interface is part of an interim API that is still
@@ -18,7 +19,10 @@ import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
* stability. It is available at this early stage to solicit feedback from
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
*/
public interface JavaOneToOneMapping2_0
- extends JavaOneToOneMapping, JavaSingleRelationshipMapping2_0
+ extends JavaOneToOneMapping, OneToOneMapping2_0, JavaSingleRelationshipMapping2_0
{}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
index 6944c2a752..af3720fbdb 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
@@ -64,15 +64,15 @@ public class GenericJavaManyToOneMapping2_0Tests
JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
resourceAttribute.removeAnnotation(JPA.ID);
assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedId().isDerivedId());
+ assertFalse(contextMapping.getDerivedId().getValue());
resourceAttribute.addAnnotation(JPA.ID);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
}
public void testSetDerivedId() throws Exception {
@@ -86,15 +86,15 @@ public class GenericJavaManyToOneMapping2_0Tests
JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
- contextMapping.getDerivedId().setDerivedId(false);
+ contextMapping.getDerivedId().setValue(false);
assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedId().isDerivedId());
+ assertFalse(contextMapping.getDerivedId().getValue());
- contextMapping.getDerivedId().setDerivedId(true);
+ contextMapping.getDerivedId().setValue(true);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
}
public void testMorphMapping() throws Exception {
@@ -107,11 +107,11 @@ public class GenericJavaManyToOneMapping2_0Tests
JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().isDerivedId());
+ assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().getValue());
contextAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().isDerivedId());
+ assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().getValue());
contextAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
@@ -119,7 +119,7 @@ public class GenericJavaManyToOneMapping2_0Tests
contextAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().isDerivedId());
+ assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().getValue());
contextAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
assertNull(resourceAttribute.getAnnotation(JPA.ID));
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
index c4e4712c81..8317d23fcb 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
@@ -64,15 +64,15 @@ public class GenericJavaOneToOneMapping2_0Tests
JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
resourceAttribute.removeAnnotation(JPA.ID);
assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedId().isDerivedId());
+ assertFalse(contextMapping.getDerivedId().getValue());
resourceAttribute.addAnnotation(JPA.ID);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
}
public void testSetDerivedId() throws Exception {
@@ -86,15 +86,15 @@ public class GenericJavaOneToOneMapping2_0Tests
JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
- contextMapping.getDerivedId().setDerivedId(false);
+ contextMapping.getDerivedId().setValue(false);
assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedId().isDerivedId());
+ assertFalse(contextMapping.getDerivedId().getValue());
- contextMapping.getDerivedId().setDerivedId(true);
+ contextMapping.getDerivedId().setValue(true);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedId().isDerivedId());
+ assertTrue(contextMapping.getDerivedId().getValue());
}
public void testMorphMapping() throws Exception {
@@ -107,11 +107,11 @@ public class GenericJavaOneToOneMapping2_0Tests
JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().isDerivedId());
+ assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().getValue());
contextAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().isDerivedId());
+ assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().getValue());
contextAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
@@ -119,7 +119,7 @@ public class GenericJavaOneToOneMapping2_0Tests
contextAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().isDerivedId());
+ assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).getDerivedId().getValue());
contextAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
assertNull(resourceAttribute.getAnnotation(JPA.ID));

Back to the top