diff options
author | bvosburgh | 2011-07-08 15:53:19 +0000 |
---|---|---|
committer | bvosburgh | 2011-07-08 15:53:19 +0000 |
commit | 4d1718874833d42c5dd754ba630a95bda12a8e5a (patch) | |
tree | e4751ebea01e03874a340e2075a20032319d26a1 /jpa/tests/org.eclipse.jpt.jpa.core.tests | |
parent | c1c13dda2e01c89bfb6604403521aa07f8b4e303 (diff) | |
download | webtools.dali-4d1718874833d42c5dd754ba630a95bda12a8e5a.tar.gz webtools.dali-4d1718874833d42c5dd754ba630a95bda12a8e5a.tar.xz webtools.dali-4d1718874833d42c5dd754ba630a95bda12a8e5a.zip |
[339432] fix validation of virtual overrides
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.jpa.core.tests')
6 files changed, 90 insertions, 91 deletions
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java index 267390e1e6..6f9b9607eb 100644 --- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java @@ -1773,19 +1773,6 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(4, overrideContainer.virtualOverridesSize()); virtualAttributeOverrides = overrideContainer.virtualOverrides(); virtualOverride = virtualAttributeOverrides.next(); - assertEquals("basic", virtualOverride.getName()); - assertEquals("MY_NAME", virtualOverride.getColumn().getSpecifiedName()); - assertEquals("BAR", virtualOverride.getColumn().getTable()); - assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition()); - assertEquals(false, virtualOverride.getColumn().isInsertable()); - assertEquals(false, virtualOverride.getColumn().isUpdatable()); - assertEquals(true, virtualOverride.getColumn().isUnique()); - assertEquals(false, virtualOverride.getColumn().isNullable()); - assertEquals(5, virtualOverride.getColumn().getLength()); - assertEquals(6, virtualOverride.getColumn().getPrecision()); - assertEquals(7, virtualOverride.getColumn().getScale()); - - virtualOverride = virtualAttributeOverrides.next(); assertEquals("foo", virtualOverride.getName()); assertEquals("FOO", virtualOverride.getColumn().getSpecifiedName());//TODO specified or default? assertEquals("BAR", virtualOverride.getColumn().getSpecifiedTable()); @@ -1797,6 +1784,19 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(Integer.valueOf(7), virtualOverride.getColumn().getSpecifiedLength()); assertEquals(Integer.valueOf(8), virtualOverride.getColumn().getSpecifiedPrecision()); assertEquals(Integer.valueOf(9), virtualOverride.getColumn().getSpecifiedScale()); + + virtualOverride = virtualAttributeOverrides.next(); + assertEquals("basic", virtualOverride.getName()); + assertEquals("MY_NAME", virtualOverride.getColumn().getSpecifiedName()); + assertEquals("BAR", virtualOverride.getColumn().getTable()); + assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition()); + assertEquals(false, virtualOverride.getColumn().isInsertable()); + assertEquals(false, virtualOverride.getColumn().isUpdatable()); + assertEquals(true, virtualOverride.getColumn().isUnique()); + assertEquals(false, virtualOverride.getColumn().isNullable()); + assertEquals(5, virtualOverride.getColumn().getLength()); + assertEquals(6, virtualOverride.getColumn().getPrecision()); + assertEquals(7, virtualOverride.getColumn().getScale()); virtualOverride = virtualAttributeOverrides.next(); assertEquals("id", virtualOverride.getName()); } @@ -2176,12 +2176,12 @@ public class OrmEntityTests extends ContextModelTestCase virtualOverrides = overrideContainer.virtualOverrides(); virtualOverride = virtualOverrides.next(); joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy(); - assertEquals("manyToOne", virtualOverride.getName()); + assertEquals("oneToOne", virtualOverride.getName()); ormJoinColumn = joiningStrategy.joinColumns().next(); - assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName()); - assertEquals("MY_REFERNCE_NAME", ormJoinColumn.getSpecifiedReferencedColumnName()); - assertEquals("BAR2", ormJoinColumn.getSpecifiedTable()); - assertEquals("COLUMN_DEF2", ormJoinColumn.getColumnDefinition()); + assertEquals("FOO", ormJoinColumn.getSpecifiedName()); + assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName()); + assertEquals("BAR", ormJoinColumn.getSpecifiedTable()); + assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition()); assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable()); assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable()); assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique()); @@ -2189,12 +2189,12 @@ public class OrmEntityTests extends ContextModelTestCase virtualOverride = virtualOverrides.next(); joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy(); - assertEquals("oneToOne", virtualOverride.getName()); + assertEquals("manyToOne", virtualOverride.getName()); ormJoinColumn = joiningStrategy.joinColumns().next(); - assertEquals("FOO", ormJoinColumn.getSpecifiedName()); - assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName()); - assertEquals("BAR", ormJoinColumn.getSpecifiedTable()); - assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition()); + assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName()); + assertEquals("MY_REFERNCE_NAME", ormJoinColumn.getSpecifiedReferencedColumnName()); + assertEquals("BAR2", ormJoinColumn.getSpecifiedTable()); + assertEquals("COLUMN_DEF2", ormJoinColumn.getColumnDefinition()); assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable()); assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable()); assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique()); diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java index a59e36bf22..30b42bf061 100644 --- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java @@ -465,7 +465,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod public void testSetJoinTableName() throws Exception { - createTestMappedSuperclass(); + createTestMappedSuperclassManyToMany(); createTestSubType(); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); @@ -473,7 +473,6 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified(); - ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).setStrategyToJoinTable(); JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); @@ -487,7 +486,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod } public void testUpdateJoinTable() throws Exception { - createTestMappedSuperclass(); + createTestMappedSuperclassManyToMany(); createTestSubType(); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); @@ -495,7 +494,6 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified(); - ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).setStrategyToJoinTable(); JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); @@ -505,6 +503,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod getJpaProject().synchronizeContextModel(); assertEquals("MY_JOIN_TABLE", joiningStrategy.getJoinTable().getSpecifiedName()); + associationOverrideResource.getJoinTable().removeJoinColumn(0); // remove default associationOverrideResource.getJoinTable().addJoinColumn(0); associationOverrideResource.getJoinTable().addJoinColumn(1); associationOverrideResource.getJoinTable().addJoinColumn(2); 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 84d453af25..5d2e2199f1 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 @@ -163,24 +163,24 @@ public class GenericJavaManyToOneMapping2_0Tests JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping(); assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID); annotation.setValue("foo"); getJpaProject().synchronizeContextModel(); assertEquals("foo", annotation.getValue()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); annotation.setValue("bar"); getJpaProject().synchronizeContextModel(); assertEquals("bar", annotation.getValue()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceAttribute.removeAnnotation(JPA2_0.MAPS_ID); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testSetMapsId() throws Exception { @@ -194,22 +194,22 @@ public class GenericJavaManyToOneMapping2_0Tests JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping(); assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo"); MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID); assertNotNull(annotation); assertEquals("foo", annotation.getValue()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar"); assertEquals("bar", annotation.getValue()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null); assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testUpdatePredominantDerivedIdentityStrategy() throws Exception { @@ -307,7 +307,7 @@ public class GenericJavaManyToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertNotNull(resourceAttribute.getAnnotation(JPA.ID)); @@ -315,7 +315,7 @@ public class GenericJavaManyToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertNotNull(resourceAttribute.getAnnotation(JPA.ID)); @@ -323,7 +323,7 @@ public class GenericJavaManyToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); assertNotNull(resourceAttribute.getAnnotation(JPA.ID)); 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 e9eecf4dc0..a3d11e5196 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 @@ -322,24 +322,24 @@ public class GenericJavaOneToOneMapping2_0Tests JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping(); assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID); annotation.setValue("foo"); getJpaProject().synchronizeContextModel(); assertEquals("foo", annotation.getValue()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); annotation.setValue("bar"); getJpaProject().synchronizeContextModel(); assertEquals("bar", annotation.getValue()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceAttribute.removeAnnotation(JPA2_0.MAPS_ID); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testSetMapsId() throws Exception { @@ -353,22 +353,22 @@ public class GenericJavaOneToOneMapping2_0Tests JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping(); assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo"); MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID); assertNotNull(annotation); assertEquals("foo", annotation.getValue()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar"); assertEquals("bar", annotation.getValue()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null); assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testUpdatePredominantDerivedIdentityStrategy() throws Exception { @@ -470,7 +470,7 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); assertEquals("foo", ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).getValue()); assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()). @@ -478,7 +478,7 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); assertEquals("foo", ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).getValue()); assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()). @@ -486,7 +486,7 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)); assertEquals("foo", ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).getValue()); assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testCandidateMappedByAttributeNames() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java index e316c9c7de..26d026ccb0 100644 --- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. + * Copyright (c) 2009, 2011 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -261,23 +261,23 @@ public class GenericOrmManyToOneMapping2_0Tests XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId("foo"); assertEquals("foo", resourceMapping.getMapsId()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId("bar"); assertEquals("bar", resourceMapping.getMapsId()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId(""); assertEquals("", resourceMapping.getMapsId()); - assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId(null); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testSetMapsId() throws Exception { @@ -289,23 +289,23 @@ public class GenericOrmManyToOneMapping2_0Tests XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo"); assertEquals("foo", resourceMapping.getMapsId()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar"); assertEquals("bar", resourceMapping.getMapsId()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(""); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(""); assertEquals("", resourceMapping.getMapsId()); - assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testUpdatePredominantDerivedIdentityStrategy() throws Exception { @@ -402,7 +402,7 @@ public class GenericOrmManyToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertEquals("foo", resourceManyToOne.getMapsId()); assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0); @@ -411,7 +411,7 @@ public class GenericOrmManyToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertEquals("foo", resourceOneToOne.getMapsId()); assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0); @@ -420,7 +420,7 @@ public class GenericOrmManyToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertEquals("foo", resourceManyToOne.getMapsId()); assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testVirtualJoinTable() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java index bf86d1be66..124609f7a8 100644 --- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. + * Copyright (c) 2009, 2011 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -324,23 +324,23 @@ public class GenericOrmOneToOneMapping2_0Tests XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId("foo"); assertEquals("foo", resourceMapping.getMapsId()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId("bar"); assertEquals("bar", resourceMapping.getMapsId()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId(""); assertEquals("", resourceMapping.getMapsId()); - assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); resourceMapping.setMapsId(null); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testSetMapsId() throws Exception { @@ -352,23 +352,23 @@ public class GenericOrmOneToOneMapping2_0Tests XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo"); assertEquals("foo", resourceMapping.getMapsId()); - assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar"); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar"); assertEquals("bar", resourceMapping.getMapsId()); - assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(""); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(""); assertEquals("", resourceMapping.getMapsId()); - assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); - contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null); + contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null); assertNull(resourceMapping.getMapsId()); - assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } public void testUpdatePredominantDerivedIdentityStrategy() throws Exception { @@ -465,7 +465,7 @@ public class GenericOrmOneToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertNull(resourceOneToOne.getMapsId()); assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0); @@ -474,7 +474,7 @@ public class GenericOrmOneToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertNull(resourceManyToOne.getMapsId()); assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0); @@ -483,7 +483,7 @@ public class GenericOrmOneToOneMapping2_0Tests getDerivedIdentity().getIdDerivedIdentityStrategy().getValue()); assertNull(resourceOneToOne.getMapsId()); assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()). - getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue()); + getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName()); } |