Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2012-04-18 16:44:44 +0000
committerpfullbright2012-04-18 16:44:44 +0000
commit1b44abe79ab5778ca5941afc525ec2000d0dba9e (patch)
tree4f785da9efb5890d1f74401d9f3043fe63a35627 /jpa/tests/org.eclipse.jpt.jpa.core.tests
parent62bccb6c0c7617a0af44b40b8c03cfc9c0c57798 (diff)
downloadwebtools.dali-1b44abe79ab5778ca5941afc525ec2000d0dba9e.tar.gz
webtools.dali-1b44abe79ab5778ca5941afc525ec2000d0dba9e.tar.xz
webtools.dali-1b44abe79ab5778ca5941afc525ec2000d0dba9e.zip
made ArrayIndexOutOfBoundsException throwing consistent
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.jpa.core.tests')
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java22
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java22
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java60
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java67
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java45
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java13
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java40
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java76
14 files changed, 275 insertions, 306 deletions
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
index 7ce0b398e8..375216868f 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
@@ -128,7 +128,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -187,7 +187,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -207,7 +207,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -227,7 +227,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedMapping() throws Exception {
@@ -267,7 +267,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToManyMapping() throws Exception {
@@ -287,7 +287,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToOneMapping() throws Exception {
@@ -307,7 +307,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToManyMapping() throws Exception {
@@ -327,7 +327,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testSpecifiedAttributeOverrides() throws Exception {
@@ -412,7 +412,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertEquals("myEmbeddedId", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -446,8 +446,8 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("myEmbeddedId", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
index c7ce2cafd5..eedbc30ef4 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
@@ -217,7 +217,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -323,7 +323,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -343,7 +343,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -363,7 +363,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedIdMapping() throws Exception {
@@ -403,7 +403,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToManyMapping() throws Exception {
@@ -423,7 +423,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToOneMapping() throws Exception {
@@ -443,7 +443,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToManyMapping() throws Exception {
@@ -463,7 +463,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testSpecifiedAttributeOverrides() throws Exception {
@@ -549,7 +549,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -583,8 +583,8 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
index d16f3b80ef..65d1d1bc53 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
@@ -11,7 +11,6 @@ package org.eclipse.jpt.jpa.core.tests.internal.context.java;
import java.util.Iterator;
import java.util.ListIterator;
-
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
@@ -408,10 +407,10 @@ public class JavaEntityTests extends ContextModelTestCase
assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(SecondaryTableAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
@@ -447,18 +446,18 @@ public class JavaEntityTests extends ContextModelTestCase
assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(SecondaryTableAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(NamedQueryAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(NamedNativeQueryAnnotation.ANNOTATION_NAME));
}
public void testMorphToNull() throws Exception {
@@ -486,18 +485,18 @@ public class JavaEntityTests extends ContextModelTestCase
assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(SecondaryTableAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(NamedQueryAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(NamedNativeQueryAnnotation.ANNOTATION_NAME));
}
public void testAccessNoAnnotations() throws Exception {
@@ -1555,7 +1554,7 @@ public class JavaEntityTests extends ContextModelTestCase
pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
assertFalse(pkJoinColumns.hasNext());
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
@@ -1893,7 +1892,7 @@ public class JavaEntityTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(5, overrideContainer.getVirtualOverridesSize());
VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -1925,8 +1924,8 @@ public class JavaEntityTests extends ContextModelTestCase
fooMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(5, overrideContainer.getVirtualOverridesSize());
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("foo", virtualAttributeOverride.getName());
@@ -1940,7 +1939,7 @@ public class JavaEntityTests extends ContextModelTestCase
assertEquals(5, virtualAttributeOverride.getColumn().getLength());
assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
+
fooMapping.getColumn().setSpecifiedName(null);
fooMapping.getColumn().setSpecifiedTable(null);
fooMapping.getColumn().setColumnDefinition(null);
@@ -1952,8 +1951,8 @@ public class JavaEntityTests extends ContextModelTestCase
fooMapping.getColumn().setSpecifiedPrecision(null);
fooMapping.getColumn().setSpecifiedScale(null);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("foo", virtualAttributeOverride.getName());
assertEquals("foo", virtualAttributeOverride.getColumn().getName());
@@ -1985,7 +1984,7 @@ public class JavaEntityTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(3, overrideContainer.getVirtualOverridesSize());
VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -2001,19 +2000,19 @@ public class JavaEntityTests extends ContextModelTestCase
idMapping.getColumn().setSpecifiedTable("BAR");
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(3, overrideContainer.getVirtualOverridesSize());
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("id", virtualAttributeOverride.getName());
assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
+
idMapping.getColumn().setSpecifiedName(null);
idMapping.getColumn().setSpecifiedTable(null);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("id", virtualAttributeOverride.getName());
assertEquals("id", virtualAttributeOverride.getColumn().getName());
@@ -2193,7 +2192,7 @@ public class JavaEntityTests extends ContextModelTestCase
attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
assertFalse(attributeOverrides.hasNext());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedAttributeOverride() throws Exception {
@@ -2474,7 +2473,7 @@ public class JavaEntityTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertEquals(2, overrideContainer.getVirtualOverridesSize());
VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -2504,8 +2503,8 @@ public class JavaEntityTests extends ContextModelTestCase
joinColumn.setSpecifiedNullable(Boolean.FALSE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(2, overrideContainer.getVirtualOverridesSize());
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
@@ -2521,27 +2520,20 @@ public class JavaEntityTests extends ContextModelTestCase
assertEquals(false, virtualJoinColumn.isUpdatable());
assertEquals(true, virtualJoinColumn.isUnique());
assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
-
-
+ assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
//idMapping.getColumn().setSpecifiedName(null);
//idMapping.getColumn().setSpecifiedTable(null);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("oneToOne", virtualAssociationOverride.getName());
virtualAssociationOverride.convertToSpecified();
assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
-
// //TODO joinColumns for default association overrides
//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
//// assertEquals("address", defaultJoinColumn.getName());
@@ -2582,7 +2574,6 @@ public class JavaEntityTests extends ContextModelTestCase
////
//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
}
public void testSpecifiedAssociationOverridesSize() throws Exception {
@@ -2717,7 +2708,7 @@ public class JavaEntityTests extends ContextModelTestCase
associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
assertFalse(associationOverrides.hasNext());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedAssociationOverride() throws Exception {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
index e9bdd2a798..1501b5fa4f 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jpa.core.tests.internal.context.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
@@ -201,14 +201,13 @@ public class JavaJoinColumnTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
//set referenced column name in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
+ JoinColumnAnnotation javaJoinColumn =
+ (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
javaJoinColumn.setName("FOO");
javaJoinColumn.setReferencedColumnName("BAR");
getJpaProject().synchronizeContextModel();
@@ -263,14 +262,13 @@ public class JavaJoinColumnTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
//set table in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
+ JoinColumnAnnotation javaJoinColumn =
+ (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
javaJoinColumn.setName("FOO");
javaJoinColumn.setTable("BAR");
getJpaProject().synchronizeContextModel();
@@ -326,14 +324,13 @@ public class JavaJoinColumnTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
//set unique in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
+ JoinColumnAnnotation javaJoinColumn =
+ (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
javaJoinColumn.setName("FOO");
javaJoinColumn.setUnique(Boolean.TRUE);
getJpaProject().synchronizeContextModel();
@@ -500,14 +497,12 @@ public class JavaJoinColumnTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
//set updatable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
+ JoinColumnAnnotation javaJoinColumn =
+ (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
javaJoinColumn.setName("FOO");
javaJoinColumn.setUpdatable(Boolean.FALSE);
getJpaProject().synchronizeContextModel();
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
index 792e4730c7..4b1071d76b 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
@@ -193,7 +193,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -212,7 +212,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToVersionMapping() throws Exception {
@@ -233,7 +233,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -254,7 +254,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedMapping() throws Exception {
@@ -275,7 +275,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedIdMapping() throws Exception {
@@ -296,7 +296,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -317,7 +317,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToOneMapping() throws Exception {
@@ -380,7 +380,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testUpdateSpecifiedTargetEntity() throws Exception {
@@ -698,8 +698,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
assertFalse(joinColumnResources.hasNext());
joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedJoinColumn() throws Exception {
@@ -826,11 +825,11 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
ManyToOneMapping mapping = (ManyToOneMapping) contextAttribute.getMapping();
ManyToOneRelationship rel = mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertTrue(rel.strategyIsJoinColumn());
rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertTrue(rel.strategyIsJoinColumn());
}
@@ -844,7 +843,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
ManyToOneMapping mapping = (ManyToOneMapping) contextAttribute.getMapping();
ManyToOneRelationship rel = mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertTrue(rel.strategyIsJoinColumn());
resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
@@ -854,7 +853,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase
resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertTrue(rel.strategyIsJoinColumn());
}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
index b7bb8cfa7f..e35ea9f1cc 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
@@ -227,7 +227,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -246,7 +246,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToVersionMapping() throws Exception {
@@ -267,7 +267,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -288,7 +288,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedMapping() throws Exception {
@@ -309,7 +309,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedIdMapping() throws Exception {
@@ -330,7 +330,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -351,7 +351,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToOneMapping() throws Exception {
@@ -414,7 +414,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
@@ -854,8 +854,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
assertFalse(joinColumnResources.hasNext());
joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedJoinColumn() throws Exception {
@@ -1293,8 +1292,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
assertFalse(joinColumnResources.hasNext());
joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
assertFalse(joinColumns.hasNext());
-
- assertNull(resourceField.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
}
public void testMovePrimaryKeyJoinColumn() throws Exception {
@@ -1409,15 +1407,15 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
OneToOneMapping mapping = (OneToOneMapping) contextAttribute.getMapping();
OneToOneRelationship rel = mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertFalse(rel.strategyIsMappedBy());
rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1425,16 +1423,16 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
assertFalse(rel.strategyIsMappedBy());
rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNotNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertTrue(rel.strategyIsMappedBy());
rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
@@ -1452,8 +1450,8 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
OneToOneMapping mapping = (OneToOneMapping) contextAttribute.getMapping();
OneToOneRelationship rel = mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
@@ -1461,7 +1459,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1470,7 +1468,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
annotation.setMappedBy("foo");
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNotNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1489,7 +1487,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNotNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
@@ -1498,7 +1496,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
annotation.setMappedBy(null);
getJpaProject().synchronizeContextModel();
assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
@@ -1506,8 +1504,8 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase
resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
index dffdb9a48f..afa350d301 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
@@ -23,12 +23,13 @@ import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.AttributeOverride;
import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
+import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
+import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
import org.eclipse.jpt.jpa.core.context.BasicMapping;
import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
import org.eclipse.jpt.jpa.core.context.FetchType;
import org.eclipse.jpt.jpa.core.context.IdMapping;
import org.eclipse.jpt.jpa.core.context.JoinColumn;
@@ -38,7 +39,6 @@ import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
import org.eclipse.jpt.jpa.core.context.TemporalType;
import org.eclipse.jpt.jpa.core.context.TransientMapping;
import org.eclipse.jpt.jpa.core.context.TypeMapping;
@@ -423,8 +423,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -445,8 +445,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToVersionMapping() throws Exception {
@@ -469,8 +469,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -493,8 +493,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedMapping() throws Exception {
@@ -542,7 +542,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -565,8 +565,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToOneMapping() throws Exception {
@@ -589,8 +589,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToManyMapping() throws Exception {
@@ -614,7 +614,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToManyMapping() throws Exception {
@@ -639,7 +639,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testUpdateSpecifiedTargetEntity() throws Exception {
@@ -1291,7 +1291,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -1325,8 +1325,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
@@ -1340,7 +1340,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertEquals(5, defaultAttributeOverride.getColumn().getLength());
assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
+
cityMapping.getColumn().setSpecifiedName(null);
cityMapping.getColumn().setSpecifiedTable(null);
cityMapping.getColumn().setColumnDefinition(null);
@@ -1770,7 +1770,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -1804,8 +1804,8 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
@@ -1819,7 +1819,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertEquals(5, defaultAttributeOverride.getColumn().getLength());
assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
+
cityMapping.getColumn().setSpecifiedName(null);
cityMapping.getColumn().setSpecifiedTable(null);
cityMapping.getColumn().setColumnDefinition(null);
@@ -1847,8 +1847,6 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
annotation.setName("key.city");
getJpaProject().synchronizeContextModel();
assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -1864,7 +1862,6 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
classRefs.next();
classRefs.next();
@@ -1883,7 +1880,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
parcelNumberMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("parcels", resourceField.getName());
-
+
assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("parcelNumber", defaultAttributeOverride.getName());
@@ -1897,7 +1894,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertEquals(5, defaultAttributeOverride.getColumn().getLength());
assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
+
parcelNumberMapping.getColumn().setSpecifiedName(null);
parcelNumberMapping.getColumn().setSpecifiedTable(null);
parcelNumberMapping.getColumn().setColumnDefinition(null);
@@ -2494,8 +2491,7 @@ public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0Conte
assertFalse(joinColumnResources.hasNext());
joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedJoinColumn() throws Exception {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
index a8557f089f..2d6ba1fd6e 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
@@ -124,7 +124,7 @@ public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModel
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -187,7 +187,7 @@ public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModel
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -209,7 +209,7 @@ public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModel
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -231,7 +231,7 @@ public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModel
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedMapping() throws Exception {
@@ -275,7 +275,7 @@ public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModel
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToManyMapping() throws Exception {
@@ -319,7 +319,7 @@ public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModel
assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToManyMapping() throws Exception {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
index 194856a99c..cfd5ff1b36 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
@@ -284,8 +284,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToDefault() throws Exception {
@@ -422,8 +422,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToTransientMapping() throws Exception {
@@ -445,8 +445,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToIdMapping() throws Exception {
@@ -469,8 +469,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToEmbeddedIdMapping() throws Exception {
@@ -494,7 +494,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToOneMapping() throws Exception {
@@ -517,8 +517,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToOneToManyMapping() throws Exception {
@@ -541,7 +541,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToOneMapping() throws Exception {
@@ -564,8 +564,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToManyToManyMapping() throws Exception {
@@ -589,7 +589,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMorphToElementCollectionMapping() throws Exception {
@@ -699,7 +699,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -733,8 +733,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
@@ -748,7 +748,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertEquals(5, defaultAttributeOverride.getColumn().getLength());
assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
+
cityMapping.getColumn().setSpecifiedName(null);
cityMapping.getColumn().setSpecifiedTable(null);
cityMapping.getColumn().setColumnDefinition(null);
@@ -1024,7 +1024,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertEquals(2, overrideContainer.getVirtualOverridesSize());
VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -1055,8 +1055,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
joinColumn.setSpecifiedUnique(Boolean.TRUE);
joinColumn.setSpecifiedNullable(Boolean.FALSE);
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(2, overrideContainer.getVirtualOverridesSize());
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
@@ -1072,12 +1072,11 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertEquals(false, virtualJoinColumn.isUpdatable());
assertEquals(true, virtualJoinColumn.isUnique());
assertEquals(false, virtualJoinColumn.isNullable());
-
+
assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("address", virtualAssociationOverride.getName());
@@ -1229,8 +1228,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertFalse(associationOverrideResources.hasNext());
associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedAssociationOverride() throws Exception {
@@ -1375,7 +1373,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertEquals(2, overrideContainer.getVirtualOverridesSize());
VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
@@ -1431,8 +1429,8 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
inverseJoinColumn.setSpecifiedUnique(Boolean.TRUE);
inverseJoinColumn.setSpecifiedNullable(Boolean.FALSE);
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(2, overrideContainer.getVirtualOverridesSize());
virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
@@ -1448,7 +1446,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertEquals(false, virtualJoinColumn.isUpdatable());
assertEquals(true, virtualJoinColumn.isUnique());
assertEquals(false, virtualJoinColumn.isNullable());
-
+
assertEquals(1, joinTable.getInverseJoinColumnsSize());
virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
@@ -1459,10 +1457,9 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe
assertEquals(false, virtualInverseJoinColumn.isUpdatable());
assertEquals(true, virtualInverseJoinColumn.isUnique());
assertEquals(false, virtualInverseJoinColumn.isNullable());
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("address", virtualAssociationOverride.getName());
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
index 7c9ee50303..088d16b764 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
@@ -793,7 +793,7 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(3, overrideContainer.getVirtualOverridesSize());
VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -809,19 +809,19 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
idMapping.getColumn().setSpecifiedTable("BAR");
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(3, overrideContainer.getVirtualOverridesSize());
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("id", virtualAttributeOverride.getName());
assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
+
idMapping.getColumn().setSpecifiedName(null);
idMapping.getColumn().setSpecifiedTable(null);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("id", virtualAttributeOverride.getName());
assertEquals("id", virtualAttributeOverride.getColumn().getName());
@@ -845,7 +845,7 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(3, overrideContainer.getVirtualOverridesSize());
VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -861,19 +861,19 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
idMapping.getColumn().setSpecifiedTable("BAR");
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(3, overrideContainer.getVirtualOverridesSize());
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("id", virtualAttributeOverride.getName());
assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
+
idMapping.getColumn().setSpecifiedName(null);
idMapping.getColumn().setSpecifiedTable(null);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("id", virtualAttributeOverride.getName());
assertEquals("id", virtualAttributeOverride.getColumn().getName());
@@ -1029,8 +1029,7 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
assertFalse(attributeOverrideResources.hasNext());
attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedAttributeOverride() throws Exception {
@@ -1292,7 +1291,7 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
assertEquals(4, overrideContainer.getVirtualOverridesSize());
VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
@@ -1305,25 +1304,23 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
//idMapping.getColumn().setSpecifiedTable("BAR");
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(4, overrideContainer.getVirtualOverridesSize());
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("address", virtualAssociationOverride.getName());
-
+
//idMapping.getColumn().setSpecifiedName(null);
//idMapping.getColumn().setSpecifiedTable(null);
assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
+
virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
assertEquals("address", virtualAssociationOverride.getName());
virtualAssociationOverride.convertToSpecified();
assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
// //TODO joinColumns for default association overrides
//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
//// assertEquals("address", defaultJoinColumn.getName());
@@ -1364,7 +1361,6 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
////
//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
}
public void testSpecifiedAssociationOverridesSize() throws Exception {
@@ -1504,8 +1500,7 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
assertFalse(associationOverrideResources.hasNext());
associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedAssociationOverride() throws Exception {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
index ac5137a041..d19caf691d 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
@@ -1261,7 +1261,7 @@ public class GenericJavaManyToManyMapping2_0Tests
JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
JavaResourceField resourceField = resourceType.getFields().iterator().next();
assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -1295,8 +1295,8 @@ public class GenericJavaManyToManyMapping2_0Tests
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
@@ -1310,7 +1310,7 @@ public class GenericJavaManyToManyMapping2_0Tests
assertEquals(5, defaultAttributeOverride.getColumn().getLength());
assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
+
cityMapping.getColumn().setSpecifiedName(null);
cityMapping.getColumn().setSpecifiedTable(null);
cityMapping.getColumn().setColumnDefinition(null);
@@ -1338,7 +1338,7 @@ public class GenericJavaManyToManyMapping2_0Tests
annotation.setName("key.city");
getJpaProject().synchronizeContextModel();
assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
+ }
public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
createTestEntityWithEmbeddableKeyManyToManyMapping();
@@ -1831,8 +1831,7 @@ public class GenericJavaManyToManyMapping2_0Tests
assertFalse(joinColumnResources.hasNext());
joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedJoinColumn() throws Exception {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
index 20189d9a68..af69689424 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
@@ -151,7 +151,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -172,7 +172,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertTrue(persistentAttribute.getMapping().isDefault());
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -195,7 +195,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -218,7 +218,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -241,7 +241,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -264,7 +264,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -287,7 +287,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -356,7 +356,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -379,7 +379,7 @@ public class GenericJavaManyToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -613,25 +613,25 @@ public class GenericJavaManyToOneMapping2_0Tests
ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsJoinTable());
rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsJoinTable());
-
+
rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertTrue(rel.strategyIsJoinTable());
-
+
rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsJoinTable());
@@ -646,7 +646,7 @@ public class GenericJavaManyToOneMapping2_0Tests
ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsJoinTable());
@@ -667,14 +667,14 @@ public class GenericJavaManyToOneMapping2_0Tests
resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertTrue(rel.strategyIsJoinTable());
-
+
resourceField.removeAnnotation(JPA.JOIN_TABLE);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsJoinTable());
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
index 489deda957..d02b835a4b 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
@@ -1314,7 +1314,7 @@ public class GenericJavaOneToManyMapping2_0Tests
OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1330,15 +1330,15 @@ public class GenericJavaOneToManyMapping2_0Tests
assertFalse(rel.strategyIsMappedBy());
rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNotNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsJoinTable());
assertTrue(rel.strategyIsMappedBy());
-
+
rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1356,7 +1356,7 @@ public class GenericJavaOneToManyMapping2_0Tests
OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1365,7 +1365,7 @@ public class GenericJavaOneToManyMapping2_0Tests
annotation.setMappedBy("foo");
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNotNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1374,7 +1374,7 @@ public class GenericJavaOneToManyMapping2_0Tests
resourceField.addAnnotation(JPA.JOIN_TABLE);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNotNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
@@ -1410,14 +1410,14 @@ public class GenericJavaOneToManyMapping2_0Tests
resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertNull(annotation.getMappedBy());
assertFalse(rel.strategyIsJoinColumn());
assertTrue(rel.strategyIsJoinTable());
assertFalse(rel.strategyIsMappedBy());
}
-
+
public void testMapKeySpecifiedAttributeOverrides() throws Exception {
createTestEntityWithEmbeddableKeyOneToManyMapping();
createTestEmbeddableAddress();
@@ -1527,7 +1527,7 @@ public class GenericJavaOneToManyMapping2_0Tests
JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
@@ -1561,8 +1561,8 @@ public class GenericJavaOneToManyMapping2_0Tests
cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
+ assertEquals(0, resourceField.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
+
assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
assertEquals("city", defaultAttributeOverride.getName());
@@ -1576,7 +1576,7 @@ public class GenericJavaOneToManyMapping2_0Tests
assertEquals(5, defaultAttributeOverride.getColumn().getLength());
assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
+
cityMapping.getColumn().setSpecifiedName(null);
cityMapping.getColumn().setSpecifiedTable(null);
cityMapping.getColumn().setColumnDefinition(null);
@@ -1604,7 +1604,7 @@ public class GenericJavaOneToManyMapping2_0Tests
annotation.setName("key.city");
getJpaProject().synchronizeContextModel();
assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
+ }
public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
createTestEntityWithEmbeddableKeyOneToManyMapping();
@@ -2092,8 +2092,7 @@ public class GenericJavaOneToManyMapping2_0Tests
assertFalse(joinColumnResources.hasNext());
joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
}
public void testMoveSpecifiedJoinColumn() throws Exception {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
index ebb5d7cb16..d85fdc5e22 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
@@ -308,7 +308,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -329,7 +329,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertTrue(persistentAttribute.getMapping().isDefault());
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -352,7 +352,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -375,7 +375,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -398,7 +398,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -421,7 +421,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -444,7 +444,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -513,7 +513,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -536,7 +536,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
+ assertEquals(0, resourceField.getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME));
assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
}
@@ -981,8 +981,8 @@ public class GenericJavaOneToOneMapping2_0Tests
OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
@@ -991,7 +991,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertFalse(rel.strategyIsJoinTable());
rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
@@ -999,30 +999,30 @@ public class GenericJavaOneToOneMapping2_0Tests
assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
assertFalse(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNotNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertTrue(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertFalse(rel.strategyIsMappedBy());
assertTrue(rel.strategyIsJoinTable());
-
+
rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
@@ -1041,8 +1041,8 @@ public class GenericJavaOneToOneMapping2_0Tests
OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());
@@ -1052,7 +1052,7 @@ public class GenericJavaOneToOneMapping2_0Tests
resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
@@ -1060,10 +1060,10 @@ public class GenericJavaOneToOneMapping2_0Tests
assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
assertFalse(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
annotation.setMappedBy("foo");
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNotNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
@@ -1071,7 +1071,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertTrue(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
@@ -1082,7 +1082,7 @@ public class GenericJavaOneToOneMapping2_0Tests
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertTrue(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
resourceField.addAnnotation(JPA.JOIN_TABLE);
getJpaProject().synchronizeContextModel();
assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
@@ -1093,44 +1093,44 @@ public class GenericJavaOneToOneMapping2_0Tests
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertTrue(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNotNull(annotation.getMappedBy());
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertTrue(rel.strategyIsMappedBy());
assertFalse(rel.strategyIsJoinTable());
-
+
annotation.setMappedBy(null);
getJpaProject().synchronizeContextModel();
assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertFalse(rel.strategyIsMappedBy());
assertTrue(rel.strategyIsJoinTable());
-
+
resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertFalse(rel.strategyIsJoinColumn());
assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
assertFalse(rel.strategyIsMappedBy());
assertTrue(rel.strategyIsJoinTable());
-
+
resourceField.removeAnnotation(JPA.JOIN_TABLE);
getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
+ assertEquals(0, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
assertNull(annotation.getMappedBy());
assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
assertTrue(rel.strategyIsJoinColumn());

Back to the top