diff options
author | kmoore | 2009-01-14 20:49:13 +0000 |
---|---|---|
committer | kmoore | 2009-01-14 20:49:13 +0000 |
commit | b9d56932e98cd8043825ac2e86daa481c0551d20 (patch) | |
tree | ba944321b42cbe6a20a332ec37f0f2cd822f55f3 /jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java | |
parent | e15629870791efee9f4cf88344c72075c9bf5333 (diff) | |
download | webtools.dali-b9d56932e98cd8043825ac2e86daa481c0551d20.tar.gz webtools.dali-b9d56932e98cd8043825ac2e86daa481c0551d20.tar.xz webtools.dali-b9d56932e98cd8043825ac2e86daa481c0551d20.zip |
added get prefix to convenience methods in tests
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java')
30 files changed, 1544 insertions, 1544 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java index dbe6d891e5..d85ab5fbf1 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java @@ -93,16 +93,16 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next(); javaAssociationOverride = javaAssociationOverride.setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); assertEquals("address", javaAssociationOverride.getName()); assertEquals("address", associationOverrideResource.getName()); - assertTrue(javaEntity().associationOverrides().hasNext()); + assertTrue(getJavaEntity().associationOverrides().hasNext()); //set name in the resource model, verify context model updated associationOverrideResource.setName("FOO"); @@ -119,7 +119,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase assertEquals("FOO", associationOverrideResource.getName()); typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); - assertFalse(javaEntity().specifiedAssociationOverrides().hasNext()); + assertFalse(getJavaEntity().specifiedAssociationOverrides().hasNext()); assertFalse(typeResource.supportingAnnotations(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES).hasNext()); } @@ -129,16 +129,16 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next(); javaAssociationOverride = javaAssociationOverride.setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); assertEquals("address", javaAssociationOverride.getName()); assertEquals("address", associationOverrideResource.getName()); - assertTrue(javaEntity().associationOverrides().hasNext()); + assertTrue(getJavaEntity().associationOverrides().hasNext()); //set name in the context model, verify resource model modified javaAssociationOverride.setName("foo"); @@ -158,11 +158,11 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next(); javaAssociationOverride = javaAssociationOverride.setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -201,11 +201,11 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next(); javaAssociationOverride = javaAssociationOverride.setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); javaAssociationOverride.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -233,11 +233,11 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next(); javaAssociationOverride = javaAssociationOverride.setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); javaAssociationOverride.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -275,11 +275,11 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AssociationOverride javaAssociationOverride = entity.virtualAssociationOverrides().next(); javaAssociationOverride = javaAssociationOverride.setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); associationOverrideResource.addJoinColumn(0); @@ -332,15 +332,15 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase createTestEntityWithAssociationOverride(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - AssociationOverride specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next(); + AssociationOverride specifiedAssociationOverride = getJavaEntity().specifiedAssociationOverrides().next(); assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); associationOverrideResource.setName("FOO"); - specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next(); + specifiedAssociationOverride = getJavaEntity().specifiedAssociationOverrides().next(); assertEquals("FOO", specifiedAssociationOverride.getName()); } @@ -348,12 +348,12 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase createTestEntityWithAssociationOverride(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - AssociationOverride specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next(); + AssociationOverride specifiedAssociationOverride = getJavaEntity().specifiedAssociationOverrides().next(); assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName()); specifiedAssociationOverride.setName("FOO"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ASSOCIATION_OVERRIDE); assertEquals("FOO", associationOverrideResource.getName()); @@ -365,7 +365,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); assertEquals("AnnotationTestTypeChild", entity.getName()); assertEquals(1, entity.virtualAssociationOverridesSize()); @@ -379,7 +379,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); assertEquals("AnnotationTestTypeChild", entity.getName()); assertEquals(1, entity.virtualAssociationOverridesSize()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java index 7bd7922e87..98cc0be341 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAttributeOverrideTests.java @@ -98,15 +98,15 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase createTestEntityWithAttributeOverride(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next(); + AttributeOverride specifiedAttributeOverride = getJavaEntity().specifiedAttributeOverrides().next(); assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE); attributeOverrideResource.setName("FOO"); - specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next(); + specifiedAttributeOverride = getJavaEntity().specifiedAttributeOverrides().next(); assertEquals("FOO", specifiedAttributeOverride.getName()); } @@ -114,12 +114,12 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase createTestEntityWithAttributeOverride(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next(); + AttributeOverride specifiedAttributeOverride = getJavaEntity().specifiedAttributeOverrides().next(); assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName()); specifiedAttributeOverride.setName("FOO"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE); assertEquals("FOO", attributeOverrideResource.getName()); @@ -129,18 +129,18 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase createTestEntityWithAttributeOverride(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next(); + AttributeOverride specifiedAttributeOverride = getJavaEntity().specifiedAttributeOverrides().next(); Column column = specifiedAttributeOverride.getColumn(); assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE); ColumnAnnotation columnResource = attributeOverrideResource.getColumn(); columnResource.setName("FOO"); - column = javaEntity().specifiedAttributeOverrides().next().getColumn(); + column = getJavaEntity().specifiedAttributeOverrides().next().getColumn(); assertEquals("FOO", column.getName()); } @@ -148,12 +148,12 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase createTestEntityWithAttributeOverride(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next(); + AttributeOverride specifiedAttributeOverride = getJavaEntity().specifiedAttributeOverrides().next(); Column column = specifiedAttributeOverride.getColumn(); assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName()); column.setSpecifiedName("FOO"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE); ColumnAnnotation columnResource = attributeOverrideResource.getColumn(); @@ -172,7 +172,7 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); assertEquals("AnnotationTestTypeChild", entity.getName()); assertEquals(2, entity.virtualAttributeOverridesSize()); @@ -180,7 +180,7 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase assertEquals("id", attributeOverride.getColumn().getDefaultName()); - JavaPersistentType mappedSuperclass = CollectionTools.list(persistenceUnit().specifiedClassRefs()).get(1).getJavaPersistentType(); + JavaPersistentType mappedSuperclass = CollectionTools.list(getPersistenceUnit().specifiedClassRefs()).get(1).getJavaPersistentType(); BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping(); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -194,7 +194,7 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); assertEquals("AnnotationTestTypeChild", entity.getName()); assertEquals(2, entity.virtualAttributeOverridesSize()); @@ -202,7 +202,7 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase assertEquals("AnnotationTestTypeChild", attributeOverride.getColumn().getDefaultTable()); - JavaPersistentType mappedSuperclass = CollectionTools.list(persistenceUnit().specifiedClassRefs()).get(1).getJavaPersistentType(); + JavaPersistentType mappedSuperclass = CollectionTools.list(getPersistenceUnit().specifiedClassRefs()).get(1).getJavaPersistentType(); BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping(); basicMapping.getColumn().setSpecifiedTable("BAR"); @@ -216,7 +216,7 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); assertEquals("AnnotationTestTypeChild", entity.getName()); assertEquals(2, entity.virtualAttributeOverridesSize()); @@ -230,7 +230,7 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); assertEquals("AnnotationTestTypeChild", entity.getName()); assertEquals(2, entity.virtualAttributeOverridesSize()); @@ -244,13 +244,13 @@ public class JavaAttributeOverrideTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); AttributeOverride attributeOverride = entity.virtualAttributeOverrides().next(); attributeOverride = attributeOverride.setVirtual(false); attributeOverride.getColumn().setSpecifiedName("FOO"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) typeResource.getSupportingAnnotation(JPA.ATTRIBUTE_OVERRIDE); assertEquals("FOO", attributeOverrideResource.getColumn().getName()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java index 1721071574..c5b7984ca3 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaBasicMappingTests.java @@ -166,7 +166,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch()); } @@ -175,7 +175,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch()); } @@ -184,7 +184,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(FetchType.EAGER, basicMapping.getFetch()); @@ -197,13 +197,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertNull(basicMapping.getSpecifiedFetch()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); basic.setFetch(org.eclipse.jpt.core.resource.java.FetchType.LAZY); @@ -215,7 +215,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMappingFetchOptionalSpecified(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(FetchType.EAGER, basicMapping.getSpecifiedFetch()); @@ -225,13 +225,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertNull(basicMapping.getSpecifiedFetch()); basicMapping.setSpecifiedFetch(FetchType.LAZY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); @@ -246,15 +246,15 @@ public class JavaBasicMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); createOrmXmlFile(); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertNull(basicMapping.getSpecifiedFetch()); assertTrue(basicMapping.isDefault()); basicMapping.setSpecifiedFetch(FetchType.LAZY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableProperties().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); @@ -274,17 +274,17 @@ public class JavaBasicMappingTests extends ContextModelTestCase protected void createOrmXmlFile() throws Exception { XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); - persistenceResource().save(null); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getPersistenceResource().save(null); } public void testSetBasicRemovedFromResourceModel() throws Exception { createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -312,9 +312,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -343,9 +343,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -373,9 +373,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -401,9 +401,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -427,9 +427,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -453,9 +453,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -479,9 +479,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -509,9 +509,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -537,9 +537,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -567,9 +567,9 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(basicMapping.isDefault()); basicMapping.getColumn().setSpecifiedName("FOO"); @@ -596,7 +596,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertEquals(true, basicMapping.isDefaultOptional()); } @@ -605,7 +605,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(true, basicMapping.isDefaultOptional()); } @@ -614,7 +614,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(true, basicMapping.isOptional()); @@ -627,13 +627,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertNull(basicMapping.getSpecifiedOptional()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); basic.setOptional(Boolean.FALSE); @@ -645,7 +645,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMappingFetchOptionalSpecified(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional()); @@ -655,13 +655,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertNull(basicMapping.getSpecifiedOptional()); basicMapping.setSpecifiedOptional(Boolean.FALSE); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); @@ -675,14 +675,14 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertNull(basicMapping.getSpecifiedOptional()); assertTrue(basicMapping.isDefault()); basicMapping.setSpecifiedOptional(Boolean.TRUE); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); @@ -704,13 +704,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertNull(basicMapping.getSpecifiedOptional()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); BasicAnnotation basic = (BasicAnnotation) attributeResource.getMappingAnnotation(JPA.BASIC); basic.setOptional(Boolean.FALSE); @@ -734,7 +734,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertFalse(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER); @@ -744,7 +744,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithLob(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertTrue(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER); @@ -754,12 +754,12 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); basicMapping.setSpecifiedConverter(Converter.LOB_CONVERTER); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(attributeResource.getSupportingAnnotation(LobAnnotation.ANNOTATION_NAME)); @@ -771,12 +771,12 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertFalse(basicMapping.getConverter().getType() == Converter.LOB_CONVERTER); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(LobAnnotation.ANNOTATION_NAME); @@ -791,7 +791,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER); } @@ -800,7 +800,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER); } @@ -809,12 +809,12 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); EnumeratedAnnotation enumeratedAnnotation = (EnumeratedAnnotation) attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME); assertEquals(EnumType.ORDINAL, ((EnumeratedConverter) basicMapping.getConverter()).getDefaultEnumType()); @@ -827,7 +827,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithEnumerated(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertEquals(EnumType.STRING, ((EnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType()); @@ -837,13 +837,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER); basicMapping.setSpecifiedConverter(Converter.ENUMERATED_CONVERTER); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.getSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME); @@ -865,13 +865,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertTrue(basicMapping.getConverter().getType() == Converter.NO_CONVERTER); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); EnumeratedAnnotation enumerated = (EnumeratedAnnotation) attributeResource.addSupportingAnnotation(EnumeratedAnnotation.ANNOTATION_NAME); enumerated.setValue(org.eclipse.jpt.core.resource.java.EnumType.STRING); @@ -889,11 +889,11 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.TEMPORAL_CONVERTER, basicMapping.getConverter().getType()); @@ -903,7 +903,7 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithTemporal(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping(); assertEquals(Converter.TEMPORAL_CONVERTER, basicMapping.getConverter().getType()); @@ -914,14 +914,14 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType()); basicMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER); ((TemporalConverter) basicMapping.getSpecifiedConverter()).setTemporalType(TemporalType.TIME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); @@ -935,13 +935,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); temporal.setValue(org.eclipse.jpt.core.resource.java.TemporalType.DATE); @@ -960,13 +960,13 @@ public class JavaBasicMappingTests extends ContextModelTestCase createTestEntityWithBasicMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping(); assertNull(basicMapping.getColumn().getSpecifiedName()); assertEquals("id", basicMapping.getColumn().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setName("foo"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java index d3e6ffccfb..057325483f 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java @@ -107,7 +107,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedName()); } @@ -116,7 +116,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithDefaultBasicColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(COLUMN_NAME, basicMapping.getColumn().getSpecifiedName()); } @@ -124,7 +124,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetDefaultNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(basicMapping.getPersistentAttribute().getName(), basicMapping.getColumn().getDefaultName()); assertEquals("id", basicMapping.getColumn().getDefaultName()); @@ -134,7 +134,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithDefaultBasicColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals("id", basicMapping.getColumn().getDefaultName()); basicMapping.getColumn().setSpecifiedName("foo"); @@ -144,7 +144,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals("id", basicMapping.getColumn().getName()); } @@ -152,7 +152,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetName() throws Exception { createTestEntityWithDefaultBasicColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(COLUMN_NAME, basicMapping.getColumn().getName()); } @@ -160,13 +160,13 @@ public class JavaColumnTests extends ContextModelTestCase public void testSetSpecifiedName() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); basicMapping.getColumn().setSpecifiedName("foo"); assertEquals("foo", basicMapping.getColumn().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -177,13 +177,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithDefaultBasicColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); basicMapping.getColumn().setSpecifiedName(null); assertNull(basicMapping.getColumn().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN)); } @@ -191,11 +191,11 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetNameUpdatesFromResourceChange() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); @@ -223,7 +223,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedTable()); } @@ -232,7 +232,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnTableSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(TABLE_NAME, basicMapping.getColumn().getSpecifiedTable()); } @@ -240,7 +240,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetDefaultTableSpecifiedTableNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(((Entity) basicMapping.getTypeMapping()).getName(), basicMapping.getColumn().getDefaultTable()); assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable()); @@ -250,7 +250,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithDefaultBasicColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable()); basicMapping.getColumn().setSpecifiedTable("foo"); @@ -260,7 +260,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetTable() throws Exception { createTestEntityWithBasicColumnTableSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(TABLE_NAME, basicMapping.getColumn().getTable()); } @@ -268,13 +268,13 @@ public class JavaColumnTests extends ContextModelTestCase public void testSetSpecifiedTable() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); basicMapping.getColumn().setSpecifiedTable("foo"); assertEquals("foo", basicMapping.getColumn().getSpecifiedTable()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -285,13 +285,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnTableSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); basicMapping.getColumn().setSpecifiedTable(null); assertNull(basicMapping.getColumn().getSpecifiedTable()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getSupportingAnnotation(JPA.COLUMN)); } @@ -299,11 +299,11 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetTableUpdatesFromResourceChange() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedTable()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); @@ -318,7 +318,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetColumnDefinition() throws Exception { createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(COLUMN_DEFINITION, basicMapping.getColumn().getColumnDefinition()); } @@ -326,11 +326,11 @@ public class JavaColumnTests extends ContextModelTestCase public void testSetColumnDefinition() throws Exception { createTestEntityWithBasicColumnTableSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); basicMapping.getColumn().setColumnDefinition("foo"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -343,11 +343,11 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetColumnDefinitionUpdatesFromResourceChange() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getColumnDefinition()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); @@ -362,7 +362,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetLength() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(Column.DEFAULT_LENGTH, basicMapping.getColumn().getLength()); basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55)); @@ -373,7 +373,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(Column.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength()); basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55)); @@ -385,11 +385,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedLength()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setLength(Integer.valueOf(66)); @@ -407,13 +407,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedLength()); basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(100)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -427,7 +427,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetPrecision() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(Column.DEFAULT_PRECISION, basicMapping.getColumn().getPrecision()); basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55)); @@ -438,7 +438,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(Column.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision()); basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55)); @@ -450,11 +450,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedPrecision()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setPrecision(Integer.valueOf(66)); @@ -472,13 +472,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedPrecision()); basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(100)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -492,7 +492,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetScale() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(Column.DEFAULT_SCALE, basicMapping.getColumn().getScale()); basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55)); @@ -503,7 +503,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(Column.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale()); basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55)); @@ -515,11 +515,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedScale()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setScale(Integer.valueOf(66)); @@ -537,13 +537,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedScale()); basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(100)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -557,7 +557,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetUnique() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isUnique()); basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE); @@ -568,7 +568,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isDefaultUnique()); basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE); @@ -580,11 +580,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedUnique()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setUnique(Boolean.TRUE); @@ -602,13 +602,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedUnique()); basicMapping.getColumn().setSpecifiedUnique(Boolean.FALSE); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -622,7 +622,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetInsertable() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isInsertable()); basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE); @@ -633,7 +633,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isDefaultInsertable()); basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE); @@ -645,11 +645,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedInsertable()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setInsertable(Boolean.TRUE); @@ -667,13 +667,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedInsertable()); basicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -687,7 +687,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetNullable() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isNullable()); basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE); @@ -698,7 +698,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isDefaultNullable()); basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE); @@ -710,11 +710,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedNullable()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setNullable(Boolean.TRUE); @@ -732,13 +732,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedNullable()); basicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); @@ -752,7 +752,7 @@ public class JavaColumnTests extends ContextModelTestCase public void testGetUpdatable() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isUpdatable()); basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE); @@ -763,7 +763,7 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertEquals(BaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isDefaultUpdatable()); basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE); @@ -775,11 +775,11 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedUpdatable()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setUpdatable(Boolean.TRUE); @@ -797,13 +797,13 @@ public class JavaColumnTests extends ContextModelTestCase createTestEntityWithBasicColumnColumnDefinitionSet(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); + BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().attributes().next().getMapping(); assertNull(basicMapping.getColumn().getSpecifiedUpdatable()); basicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.getSupportingAnnotation(JPA.COLUMN); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java index ee778d2909..81348142ef 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java @@ -62,56 +62,56 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedName()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName()); } public void testGetSpecifiedName() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DISCRIMINATOR_COLUMN_NAME, javaEntity().getDiscriminatorColumn().getSpecifiedName()); + assertEquals(DISCRIMINATOR_COLUMN_NAME, getJavaEntity().getDiscriminatorColumn().getSpecifiedName()); } public void testGetDefaultNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getDefaultName()); + assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName()); } public void testGetDefaultName() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getDefaultName()); + assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName()); - javaEntity().getDiscriminatorColumn().setSpecifiedName("foo"); - assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getDefaultName()); + getJavaEntity().getDiscriminatorColumn().setSpecifiedName("foo"); + assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName()); } public void testGetNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals("DTYPE", javaEntity().getDiscriminatorColumn().getName()); + assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getName()); } public void testGetName() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DISCRIMINATOR_COLUMN_NAME, javaEntity().getDiscriminatorColumn().getName()); + assertEquals(DISCRIMINATOR_COLUMN_NAME, getJavaEntity().getDiscriminatorColumn().getName()); } public void testSetSpecifiedName() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().getDiscriminatorColumn().setSpecifiedName("foo"); + getJavaEntity().getDiscriminatorColumn().setSpecifiedName("foo"); - assertEquals("foo", javaEntity().getDiscriminatorColumn().getSpecifiedName()); + assertEquals("foo", getJavaEntity().getDiscriminatorColumn().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); assertEquals("foo", discriminatorColumn.getName()); @@ -121,11 +121,11 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().getDiscriminatorColumn().setSpecifiedName(null); + getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedName()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); assertNull(discriminatorColumn); @@ -135,48 +135,48 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DiscriminatorType.STRING, javaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType()); + assertEquals(DiscriminatorType.STRING, getJavaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType()); } public void testGetDiscriminatorType() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DiscriminatorType.STRING, javaEntity().getDiscriminatorColumn().getDiscriminatorType()); + assertEquals(DiscriminatorType.STRING, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType()); - javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR); - assertEquals(DiscriminatorType.CHAR, javaEntity().getDiscriminatorColumn().getDiscriminatorType()); + getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR); + assertEquals(DiscriminatorType.CHAR, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType()); } public void testGetSpecifiedDiscriminatorType() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); discriminatorColumn.setDiscriminatorType(org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR); - assertEquals(DiscriminatorType.CHAR, javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); + assertEquals(DiscriminatorType.CHAR, getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); } public void testSetSpecifiedDiscriminatorType() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); - javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR); + getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); assertEquals(org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR, discriminatorColumn.getDiscriminatorType()); - javaEntity().getDiscriminatorColumn().setSpecifiedName(null); - javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(null); + getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null); + getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(null); assertNull(typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN)); } @@ -184,73 +184,73 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.addSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); column.setDiscriminatorType(org.eclipse.jpt.core.resource.java.DiscriminatorType.INTEGER); - assertEquals(DiscriminatorType.INTEGER, javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); - assertEquals(DiscriminatorType.INTEGER, javaEntity().getDiscriminatorColumn().getDiscriminatorType()); + assertEquals(DiscriminatorType.INTEGER, getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); + assertEquals(DiscriminatorType.INTEGER, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType()); column.setDiscriminatorType(null); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); - assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, javaEntity().getDiscriminatorColumn().getDiscriminatorType()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType()); + assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType()); } public void testGetLength() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getLength()); - javaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55)); - assertEquals(55, javaEntity().getDiscriminatorColumn().getLength()); + assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getLength()); + getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55)); + assertEquals(55, getJavaEntity().getDiscriminatorColumn().getLength()); } public void testGetDefaultLength() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getDefaultLength()); - javaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55)); + assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getDefaultLength()); + getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55)); - assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getDefaultLength()); + assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getDefaultLength()); } public void testGetSpecifiedLength() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); discriminatorColumn.setLength(Integer.valueOf(66)); - assertEquals(Integer.valueOf(66), javaEntity().getDiscriminatorColumn().getSpecifiedLength()); - assertEquals(66, javaEntity().getDiscriminatorColumn().getLength()); + assertEquals(Integer.valueOf(66), getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertEquals(66, getJavaEntity().getDiscriminatorColumn().getLength()); discriminatorColumn.setName(null); discriminatorColumn.setLength(null); assertNull(typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN)); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); } public void testSetSpecifiedLength() throws Exception { createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); - javaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(100)); + getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(100)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); assertEquals(Integer.valueOf(100), discriminatorColumn.getLength()); - javaEntity().getDiscriminatorColumn().setSpecifiedName(null); - javaEntity().getDiscriminatorColumn().setSpecifiedLength(null); + getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null); + getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(null); assertNull(typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN)); } @@ -258,18 +258,18 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.addSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); column.setLength(Integer.valueOf(78)); - assertEquals(Integer.valueOf(78), javaEntity().getDiscriminatorColumn().getSpecifiedLength()); - assertEquals(78, javaEntity().getDiscriminatorColumn().getLength()); + assertEquals(Integer.valueOf(78), getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertEquals(78, getJavaEntity().getDiscriminatorColumn().getLength()); column.setLength(null); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedLength()); - assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, javaEntity().getDiscriminatorColumn().getLength()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength()); + assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getLength()); } @@ -277,17 +277,17 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDiscriminatorColumn().getColumnDefinition()); + assertNull(getJavaEntity().getDiscriminatorColumn().getColumnDefinition()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); column.setColumnDefinition(COLUMN_DEFINITION); - assertEquals(COLUMN_DEFINITION, javaEntity().getDiscriminatorColumn().getColumnDefinition()); + assertEquals(COLUMN_DEFINITION, getJavaEntity().getDiscriminatorColumn().getColumnDefinition()); column.setColumnDefinition(null); - assertNull(javaEntity().getDiscriminatorColumn().getColumnDefinition()); + assertNull(getJavaEntity().getDiscriminatorColumn().getColumnDefinition()); typeResource.removeSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); } @@ -296,14 +296,14 @@ public class JavaDiscriminatorColumnTests extends ContextModelTestCase createTestEntityWithDiscriminatorColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().getDiscriminatorColumn().setColumnDefinition("foo"); + getJavaEntity().getDiscriminatorColumn().setColumnDefinition("foo"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); assertEquals("foo", column.getColumnDefinition()); - javaEntity().getDiscriminatorColumn().setColumnDefinition(null); + getJavaEntity().getDiscriminatorColumn().setColumnDefinition(null); column = (DiscriminatorColumnAnnotation) typeResource.getSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); assertNull(column.getColumnDefinition()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java index cf42052cfb..176178bb91 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddableTests.java @@ -47,10 +47,10 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof Entity); + getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof Entity); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME)); } @@ -58,10 +58,10 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof MappedSuperclass); + getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME)); } @@ -69,24 +69,24 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof JavaNullTypeMapping); + getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME)); } public void testEmbeddable() throws Exception { createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertTrue(javaPersistentType().getMapping() instanceof Embeddable); + assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable); } public void testOverridableAttributeNames() throws Exception { createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); Iterator<String> overridableAttributeNames = embeddable.overridableAttributeNames(); assertFalse(overridableAttributeNames.hasNext()); } @@ -95,7 +95,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); Iterator<String> overridableAssociationNames = embeddable.overridableAssociationNames(); assertFalse(overridableAssociationNames.hasNext()); } @@ -104,7 +104,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); assertFalse(embeddable.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME)); assertFalse(embeddable.tableNameIsInvalid("FOO")); @@ -114,7 +114,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY)); assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY)); assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)); @@ -132,7 +132,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); assertFalse(embeddable.associatedTables().hasNext()); } @@ -141,7 +141,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); assertFalse(embeddable.associatedTablesIncludingInherited().hasNext()); } @@ -150,7 +150,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); assertFalse(embeddable.associatedTableNamesIncludingInherited().hasNext()); } @@ -159,7 +159,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); Iterator<String> overridableAttributeNames = embeddable.overridableAttributeNames(); assertFalse(overridableAttributeNames.hasNext()); } @@ -169,7 +169,7 @@ public class JavaEmbeddableTests extends ContextModelTestCase createTestEmbeddable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Embeddable embeddable = (Embeddable) javaPersistentType().getMapping(); + Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping(); Iterator<String> overridableAssociationNames = embeddable.overridableAssociationNames(); assertFalse(overridableAssociationNames.hasNext()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java index 3e4013ef1c..c57410d55e 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java @@ -111,9 +111,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -133,9 +133,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -152,7 +152,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createTestEntityWithEmbeddedIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); @@ -171,9 +171,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -191,9 +191,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -211,9 +211,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -231,9 +231,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -251,9 +251,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -271,9 +271,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -291,9 +291,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -311,9 +311,9 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedIdMapping.isDefault()); @@ -332,13 +332,13 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = embeddedIdMapping.specifiedAttributeOverrides(); assertFalse(specifiedAttributeOverrides.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -395,8 +395,8 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertEquals("myEmbeddedId", attributeResource.getName()); assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME)); @@ -409,7 +409,7 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable()); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping(); @@ -441,10 +441,10 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); assertEquals(0, embeddedIdMapping.specifiedAttributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -462,10 +462,10 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); assertEquals(2, embeddedIdMapping.attributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -487,10 +487,10 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); assertEquals(2, embeddedIdMapping.virtualAttributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -514,11 +514,11 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false); embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); @@ -550,13 +550,13 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); ListIterator<AttributeOverride> virtualAttributeOverrides = embeddedIdMapping.virtualAttributeOverrides(); virtualAttributeOverrides.next(); virtualAttributeOverrides.next().setVirtual(false); embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); @@ -572,11 +572,11 @@ public class JavaEmbeddedIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) javaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); + EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping(); embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false); embeddedIdMapping.virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.moveSupportingAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java index dda4c2e03a..7cf7f0191f 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEmbeddedMappingTests.java @@ -111,7 +111,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); @@ -119,7 +119,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -132,9 +132,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -151,7 +151,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createTestEntityWithEmbeddedMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); @@ -171,7 +171,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".Entity1"); addXmlClassRef(PACKAGE_NAME + ".Embeddable1"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertNull(persistentAttribute.getSpecifiedMapping()); assertNotNull(persistentAttribute.getMapping()); assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey()); @@ -217,9 +217,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -237,9 +237,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -257,9 +257,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -277,9 +277,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -297,9 +297,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -317,9 +317,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -337,9 +337,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -357,9 +357,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase createEmbeddableType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); assertFalse(embeddedMapping.isDefault()); @@ -378,13 +378,13 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = embeddedMapping.specifiedAttributeOverrides(); assertFalse(specifiedAttributeOverrides.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -441,9 +441,9 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertEquals("myEmbedded", attributeResource.getName()); assertNull(attributeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME)); @@ -456,7 +456,7 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable()); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping(); @@ -492,10 +492,10 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); assertEquals(0, embeddedMapping.specifiedAttributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -513,10 +513,10 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); assertEquals(2, embeddedMapping.attributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -538,10 +538,10 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); assertEquals(2, embeddedMapping.virtualAttributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -565,11 +565,11 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); embeddedMapping.virtualAttributeOverrides().next().setVirtual(false); embeddedMapping.virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); @@ -601,13 +601,13 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); ListIterator<AttributeOverride> virtualAttributeOverrides = embeddedMapping.virtualAttributeOverrides(); virtualAttributeOverrides.next(); virtualAttributeOverrides.next().setVirtual(false); embeddedMapping.virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> attributeOverrides = attributeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); @@ -622,11 +622,11 @@ public class JavaEmbeddedMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME); - EmbeddedMapping embeddedMapping = (EmbeddedMapping) javaPersistentType().getAttributeNamed("myEmbedded").getMapping(); + EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping(); embeddedMapping.virtualAttributeOverrides().next().setVirtual(false); embeddedMapping.virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.moveSupportingAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java index b722263495..7a9861abb8 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java @@ -268,11 +268,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = (Entity) javaPersistentType().getMapping(); + Entity entity = (Entity) getJavaPersistentType().getMapping(); entity.getTable().setSpecifiedName("FOO"); entity.addSpecifiedSecondaryTable(0); entity.addSpecifiedPrimaryKeyJoinColumn(0); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED); @@ -284,8 +284,8 @@ public class JavaEntityTests extends ContextModelTestCase entity.addNamedNativeQuery(0); entity.addNamedQuery(0); - javaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof MappedSuperclass); + getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass); assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(TableAnnotation.ANNOTATION_NAME)); @@ -307,11 +307,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = (Entity) javaPersistentType().getMapping(); + Entity entity = (Entity) getJavaPersistentType().getMapping(); entity.getTable().setSpecifiedName("FOO"); entity.addSpecifiedSecondaryTable(0); entity.addSpecifiedPrimaryKeyJoinColumn(0); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED); @@ -323,8 +323,8 @@ public class JavaEntityTests extends ContextModelTestCase entity.addNamedNativeQuery(0); entity.addNamedQuery(0); - javaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof Embeddable); + getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable); assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(TableAnnotation.ANNOTATION_NAME)); @@ -346,11 +346,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = (Entity) javaPersistentType().getMapping(); + Entity entity = (Entity) getJavaPersistentType().getMapping(); entity.getTable().setSpecifiedName("FOO"); entity.addSpecifiedSecondaryTable(0); entity.addSpecifiedPrimaryKeyJoinColumn(0); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED); @@ -362,8 +362,8 @@ public class JavaEntityTests extends ContextModelTestCase entity.addNamedNativeQuery(0); entity.addNamedQuery(0); - javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof JavaNullTypeMapping); + getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping); assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(TableAnnotation.ANNOTATION_NAME)); @@ -384,7 +384,7 @@ public class JavaEntityTests extends ContextModelTestCase public void testAccessNoAnnotations() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(AccessType.FIELD, javaPersistentType().getAccess()); + assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess()); } public void testAccessAnnotationsOnParent() throws Exception { @@ -394,16 +394,16 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); - JavaPersistentType childPersistentType = javaPersistentType(); + JavaPersistentType childPersistentType = getJavaPersistentType(); PersistentType parentPersistentType = childPersistentType.getParentPersistentType(); assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess()); assertEquals(AccessType.PROPERTY, childPersistentType.getAccess()); ((IdMapping) parentPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.persistableProperties().next().setMappingAnnotation(null); //no mapping(Id) annotation, but still a Column annotation, so access should still be property assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess()); @@ -413,22 +413,22 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals(AccessType.FIELD, parentPersistentType.getAccess()); assertEquals(AccessType.FIELD, childPersistentType.getAccess()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess()); assertEquals(AccessType.PROPERTY, childPersistentType.getAccess()); - entityMappings().setSpecifiedAccess(AccessType.FIELD); + getEntityMappings().setSpecifiedAccess(AccessType.FIELD); //still accessType of PROPERTY because the java class is not specified in this orm.xml assertEquals(AccessType.PROPERTY, parentPersistentType.getAccess()); assertEquals(AccessType.PROPERTY, childPersistentType.getAccess()); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); //only parent specified in orm.xml, i think this outcome is right?? assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess()); assertEquals(AccessType.FIELD, childPersistentType.getAccess()); - OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType childOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); removeXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); //both parent and child specified in orm.xml assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess()); @@ -440,27 +440,27 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); - assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess()); + assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess()); - ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO"); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.persistableProperties().next().setMappingAnnotation(null); //no mapping(Id) annotation, but still a Column annotation, so access should still be property - assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess()); + assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess()); - ((BasicMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null); - assertEquals(AccessType.FIELD, javaPersistentType().getAccess()); + ((BasicMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null); + assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); - assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess()); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess()); - entityMappings().setSpecifiedAccess(AccessType.FIELD); + getEntityMappings().setSpecifiedAccess(AccessType.FIELD); //still accessType of PROPERTY because the java class is not specified in this orm.xml - assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess()); + assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess()); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); //now class is specified in orm.xml, so entityMappings access setting wins over persistence-unit-defaults assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess()); @@ -475,53 +475,53 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getSpecifiedName()); + assertNull(getJavaEntity().getSpecifiedName()); } public void testGetSpecifiedName() throws Exception { createTestEntityWithName(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(ENTITY_NAME, javaEntity().getSpecifiedName()); + assertEquals(ENTITY_NAME, getJavaEntity().getSpecifiedName()); } public void testGetDefaultNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getDefaultName()); + assertEquals(TYPE_NAME, getJavaEntity().getDefaultName()); } public void testGetDefaultName() throws Exception { createTestEntityWithName(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getDefaultName()); + assertEquals(TYPE_NAME, getJavaEntity().getDefaultName()); } public void testGetNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getName()); + assertEquals(TYPE_NAME, getJavaEntity().getName()); } public void testGetName() throws Exception { createTestEntityWithName(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(ENTITY_NAME, javaEntity().getName()); + assertEquals(ENTITY_NAME, getJavaEntity().getName()); } public void testSetSpecifiedName() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().setSpecifiedName("foo"); + getJavaEntity().setSpecifiedName("foo"); - assertEquals("foo", javaEntity().getSpecifiedName()); + assertEquals("foo", getJavaEntity().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals("foo", ((EntityAnnotation) typeResource.getMappingAnnotation()).getName()); } @@ -530,11 +530,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithName(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().setSpecifiedName(null); + getJavaEntity().setSpecifiedName(null); - assertNull(javaEntity().getSpecifiedName()); + assertNull(getJavaEntity().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(((EntityAnnotation) typeResource.getMappingAnnotation()).getName()); } @@ -543,46 +543,46 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithName(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); EntityAnnotation entity = (EntityAnnotation) typeResource.getMappingAnnotation(); entity.setName("foo"); - assertEquals("foo", javaEntity().getSpecifiedName()); + assertEquals("foo", getJavaEntity().getSpecifiedName()); } public void testGetTableName() throws Exception { addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); createTestEntityWithName(); - assertEquals(ENTITY_NAME, javaEntity().getPrimaryTableName()); + assertEquals(ENTITY_NAME, getJavaEntity().getPrimaryTableName()); } public void testGetTableName2() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getPrimaryTableName()); + assertEquals(TYPE_NAME, getJavaEntity().getPrimaryTableName()); } public void testGetTableName3() throws Exception { createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TABLE_NAME, javaEntity().getPrimaryTableName()); + assertEquals(TABLE_NAME, getJavaEntity().getPrimaryTableName()); } public void testSetTableNameWithNullTable() throws Exception { ICompilationUnit cu = createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); assertEquals(TYPE_NAME, table.getName()); assertSourceDoesNotContain("@Table", cu); table.setSpecifiedName(TABLE_NAME); assertSourceContains("@Table(name=\"" + TABLE_NAME + "\")", cu); - assertEquals(TABLE_NAME, javaEntity().getPrimaryTableName()); + assertEquals(TABLE_NAME, getJavaEntity().getPrimaryTableName()); assertEquals(TABLE_NAME, table.getName()); table.setSpecifiedCatalog(TABLE_NAME); @@ -592,7 +592,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithInheritance(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getInheritanceStrategy()); + assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getInheritanceStrategy()); } public void testGetDefaultInheritanceStrategy() throws Exception { @@ -602,46 +602,46 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNotSame(javaEntity(), javaEntity().getRootEntity()); - assertEquals(InheritanceType.SINGLE_TABLE, javaEntity().getDefaultInheritanceStrategy()); + assertNotSame(getJavaEntity(), getJavaEntity().getRootEntity()); + assertEquals(InheritanceType.SINGLE_TABLE, getJavaEntity().getDefaultInheritanceStrategy()); //change root inheritance strategy, verify default is changed for child entity - javaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS); + getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS); - assertEquals(InheritanceType.SINGLE_TABLE, javaEntity().getRootEntity().getDefaultInheritanceStrategy()); - assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getDefaultInheritanceStrategy()); - assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getInheritanceStrategy()); - assertNull(javaEntity().getSpecifiedInheritanceStrategy()); + assertEquals(InheritanceType.SINGLE_TABLE, getJavaEntity().getRootEntity().getDefaultInheritanceStrategy()); + assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getDefaultInheritanceStrategy()); + assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getInheritanceStrategy()); + assertNull(getJavaEntity().getSpecifiedInheritanceStrategy()); } public void testGetSpecifiedInheritanceStrategy() throws Exception { createTestEntityWithInheritance(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getSpecifiedInheritanceStrategy()); + assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getSpecifiedInheritanceStrategy()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME); inheritance.setStrategy(org.eclipse.jpt.core.resource.java.InheritanceType.JOINED); - assertEquals(InheritanceType.JOINED, javaEntity().getSpecifiedInheritanceStrategy()); + assertEquals(InheritanceType.JOINED, getJavaEntity().getSpecifiedInheritanceStrategy()); inheritance.setStrategy(null); - assertNull(javaEntity().getSpecifiedInheritanceStrategy()); + assertNull(getJavaEntity().getSpecifiedInheritanceStrategy()); } public void testSetSpecifiedInheritanceStrategy() throws Exception { createTestEntityWithInheritance(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(InheritanceType.TABLE_PER_CLASS, javaEntity().getSpecifiedInheritanceStrategy()); + assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getSpecifiedInheritanceStrategy()); - javaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED); + getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED); - assertEquals(InheritanceType.JOINED, javaEntity().getSpecifiedInheritanceStrategy()); + assertEquals(InheritanceType.JOINED, getJavaEntity().getSpecifiedInheritanceStrategy()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); InheritanceAnnotation inheritance = (InheritanceAnnotation) typeResource.getSupportingAnnotation(InheritanceAnnotation.ANNOTATION_NAME); assertEquals(org.eclipse.jpt.core.resource.java.InheritanceType.JOINED, inheritance.getStrategy()); @@ -651,48 +651,48 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithDiscriminatorValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DISCRIMINATOR_VALUE, javaEntity().getDiscriminatorValue()); + assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getDiscriminatorValue()); } public void testGetDefaultDiscriminatorValue() throws Exception { createTestEntityWithDiscriminatorValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(javaEntity().getName(), javaEntity().getDefaultDiscriminatorValue()); + assertEquals(getJavaEntity().getName(), getJavaEntity().getDefaultDiscriminatorValue()); - javaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER); - assertNull(javaEntity().getDefaultDiscriminatorValue()); + getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER); + assertNull(getJavaEntity().getDefaultDiscriminatorValue()); } public void testGetSpecifiedDiscriminatorValue() throws Exception { createTestEntityWithDiscriminatorValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DISCRIMINATOR_VALUE, javaEntity().getSpecifiedDiscriminatorValue()); + assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getSpecifiedDiscriminatorValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME); discriminatorValue.setValue("foo"); - assertEquals("foo", javaEntity().getSpecifiedDiscriminatorValue()); + assertEquals("foo", getJavaEntity().getSpecifiedDiscriminatorValue()); discriminatorValue.setValue(null); - assertNull(javaEntity().getSpecifiedDiscriminatorValue()); + assertNull(getJavaEntity().getSpecifiedDiscriminatorValue()); assertNull(typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME)); } public void testSetSpecifiedDiscriminatorValue() throws Exception { createTestEntityWithDiscriminatorValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(DISCRIMINATOR_VALUE, javaEntity().getSpecifiedDiscriminatorValue()); + assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getSpecifiedDiscriminatorValue()); - javaEntity().setSpecifiedDiscriminatorValue("foo"); + getJavaEntity().setSpecifiedDiscriminatorValue("foo"); - assertEquals("foo", javaEntity().getSpecifiedDiscriminatorValue()); + assertEquals("foo", getJavaEntity().getSpecifiedDiscriminatorValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) typeResource.getSupportingAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME); assertEquals("foo", discriminatorValue.getValue()); } @@ -701,7 +701,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaSecondaryTable> secondaryTables = javaEntity().secondaryTables(); + ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().secondaryTables(); assertTrue(secondaryTables.hasNext()); assertEquals("foo", secondaryTables.next().getName()); @@ -712,8 +712,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(0, entity.secondaryTablesSize()); @@ -728,7 +728,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithSecondaryTables(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaSecondaryTable> specifiedSecondaryTables = javaEntity().specifiedSecondaryTables(); + ListIterator<JavaSecondaryTable> specifiedSecondaryTables = getJavaEntity().specifiedSecondaryTables(); assertTrue(specifiedSecondaryTables.hasNext()); assertEquals("foo", specifiedSecondaryTables.next().getName()); @@ -740,8 +740,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(0, entity.specifiedSecondaryTablesSize()); @@ -756,11 +756,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR"); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); Iterator<NestableAnnotation> secondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME); assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName()); @@ -773,11 +773,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); Iterator<NestableAnnotation> secondaryTables = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME); assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName()); @@ -790,18 +790,18 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable specifiedSecondaryTable = javaEntity().addSpecifiedSecondaryTable(0); + SecondaryTable specifiedSecondaryTable = getJavaEntity().addSpecifiedSecondaryTable(0); specifiedSecondaryTable.setSpecifiedName("FOO"); specifiedSecondaryTable.setSpecifiedCatalog("CATALOG"); specifiedSecondaryTable.setSpecifiedSchema("SCHEMA"); specifiedSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("PK_NAME"); //add another specified secondary table, pkJoinColumns from first should be saved. - SecondaryTable specifiedSecondaryTable2 = javaEntity().addSpecifiedSecondaryTable(1); + SecondaryTable specifiedSecondaryTable2 = getJavaEntity().addSpecifiedSecondaryTable(1); specifiedSecondaryTable2.setSpecifiedName("BAR"); - Iterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables(); + Iterator<SecondaryTable> secondaryTables = getJavaEntity().secondaryTables(); SecondaryTable secondaryTable = secondaryTables.next(); assertEquals(secondaryTable, specifiedSecondaryTable); assertEquals("FOO", secondaryTable.getName()); @@ -822,41 +822,41 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); - javaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME))); - javaEntity().removeSpecifiedSecondaryTable(1); + getJavaEntity().removeSpecifiedSecondaryTable(1); Iterator<NestableAnnotation> secondaryTableResources = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME); assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName()); assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName()); assertFalse(secondaryTableResources.hasNext()); - Iterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables(); + Iterator<SecondaryTable> secondaryTables = getJavaEntity().secondaryTables(); assertEquals("FOO", secondaryTables.next().getName()); assertEquals("BAZ", secondaryTables.next().getName()); assertFalse(secondaryTables.hasNext()); - javaEntity().removeSpecifiedSecondaryTable(1); + getJavaEntity().removeSpecifiedSecondaryTable(1); secondaryTableResources = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME); assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName()); assertFalse(secondaryTableResources.hasNext()); - secondaryTables = javaEntity().secondaryTables(); + secondaryTables = getJavaEntity().secondaryTables(); assertEquals("FOO", secondaryTables.next().getName()); assertFalse(secondaryTables.hasNext()); - javaEntity().removeSpecifiedSecondaryTable(0); + getJavaEntity().removeSpecifiedSecondaryTable(0); secondaryTableResources = typeResource.supportingAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME); assertFalse(secondaryTableResources.hasNext()); - secondaryTables = javaEntity().secondaryTables(); + secondaryTables = getJavaEntity().secondaryTables(); assertFalse(secondaryTables.hasNext()); assertNull(typeResource.getSupportingAnnotation(SecondaryTablesAnnotation.ANNOTATION_NAME)); @@ -866,8 +866,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); entity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); @@ -905,8 +905,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("FOO"); ((SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -952,8 +952,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithSecondaryTables(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(3, CollectionTools.size(javaEntity().associatedTables())); - Iterator<Table> associatedTables = javaEntity().associatedTables(); + assertEquals(3, CollectionTools.size(getJavaEntity().associatedTables())); + Iterator<Table> associatedTables = getJavaEntity().associatedTables(); Table table1 = associatedTables.next(); SecondaryTable table2 = (SecondaryTable) associatedTables.next(); SecondaryTable table3 = (SecondaryTable) associatedTables.next(); @@ -968,7 +968,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity parentEntity = javaEntity().getRootEntity(); + Entity parentEntity = getJavaEntity().getRootEntity(); assertEquals(3, CollectionTools.size(parentEntity.associatedTablesIncludingInherited())); Iterator<Table> associatedTables = parentEntity.associatedTablesIncludingInherited(); Table table1 = associatedTables.next(); @@ -978,7 +978,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals("foo", table2.getName()); assertEquals("bar", table3.getName()); - Entity childEntity = javaEntity(); + Entity childEntity = getJavaEntity(); //TODO probably want this to be 3, since in this case the child descriptor really uses the //parent table because it is single table inheritance strategy. Not sure yet how to deal with this. assertEquals(4, CollectionTools.size(childEntity.associatedTablesIncludingInherited())); @@ -990,7 +990,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity parentEntity = javaEntity().getRootEntity(); + Entity parentEntity = getJavaEntity().getRootEntity(); assertEquals(3, CollectionTools.size(parentEntity.associatedTableNamesIncludingInherited())); Iterator<String> associatedTables = parentEntity.associatedTableNamesIncludingInherited(); String table1 = associatedTables.next(); @@ -1000,7 +1000,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals("foo", table2); assertEquals("bar", table3); - Entity childEntity = javaEntity(); + Entity childEntity = getJavaEntity(); //TODO probably want this to be 3, since in this case the child descriptor really uses the //parent table because it is single table inheritance strategy. Not sure yet how to deal with this. assertEquals(4, CollectionTools.size(childEntity.associatedTableNamesIncludingInherited())); @@ -1010,27 +1010,27 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithName(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); secondaryTable.setName("FOO"); - assertEquals(1, javaEntity().secondaryTablesSize()); - assertEquals("FOO", javaEntity().secondaryTables().next().getSpecifiedName()); - assertEquals("FOO", javaEntity().secondaryTables().next().getName()); + assertEquals(1, getJavaEntity().secondaryTablesSize()); + assertEquals("FOO", getJavaEntity().secondaryTables().next().getSpecifiedName()); + assertEquals("FOO", getJavaEntity().secondaryTables().next().getName()); SecondaryTableAnnotation secondaryTable2 = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); secondaryTable2.setName("BAR"); - assertEquals(2, javaEntity().secondaryTablesSize()); - ListIterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables(); + assertEquals(2, getJavaEntity().secondaryTablesSize()); + ListIterator<SecondaryTable> secondaryTables = getJavaEntity().secondaryTables(); assertEquals("FOO", secondaryTables.next().getSpecifiedName()); assertEquals("BAR", secondaryTables.next().getSpecifiedName()); SecondaryTableAnnotation secondaryTable3 = (SecondaryTableAnnotation) typeResource.addSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); secondaryTable3.setName("BAZ"); - assertEquals(3, javaEntity().secondaryTablesSize()); - secondaryTables = javaEntity().secondaryTables(); + assertEquals(3, getJavaEntity().secondaryTablesSize()); + secondaryTables = getJavaEntity().secondaryTables(); assertEquals("BAZ", secondaryTables.next().getSpecifiedName()); assertEquals("FOO", secondaryTables.next().getSpecifiedName()); assertEquals("BAR", secondaryTables.next().getSpecifiedName()); @@ -1040,33 +1040,33 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithSecondaryTables(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("baz"); - ListIterator<SecondaryTable> secondaryTables = javaEntity().secondaryTables(); + getJavaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("baz"); + ListIterator<SecondaryTable> secondaryTables = getJavaEntity().secondaryTables(); - assertEquals(3, javaEntity().secondaryTablesSize()); + assertEquals(3, getJavaEntity().secondaryTablesSize()); assertEquals("foo", secondaryTables.next().getSpecifiedName()); assertEquals("bar", secondaryTables.next().getSpecifiedName()); assertEquals("baz", secondaryTables.next().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); - secondaryTables = javaEntity().secondaryTables(); - assertEquals(2, javaEntity().secondaryTablesSize()); + secondaryTables = getJavaEntity().secondaryTables(); + assertEquals(2, getJavaEntity().secondaryTablesSize()); assertEquals("bar", secondaryTables.next().getSpecifiedName()); assertEquals("baz", secondaryTables.next().getSpecifiedName()); typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); - secondaryTables = javaEntity().secondaryTables(); - assertEquals(1, javaEntity().secondaryTablesSize()); + secondaryTables = getJavaEntity().secondaryTables(); + assertEquals(1, getJavaEntity().secondaryTablesSize()); assertEquals("baz", secondaryTables.next().getSpecifiedName()); typeResource.removeSupportingAnnotation(0, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); - secondaryTables = javaEntity().secondaryTables(); - assertEquals(0, javaEntity().secondaryTablesSize()); + secondaryTables = getJavaEntity().secondaryTables(); + assertEquals(0, getJavaEntity().secondaryTablesSize()); assertFalse(secondaryTables.hasNext()); } @@ -1074,36 +1074,36 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getSequenceGenerator()); - assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); + assertNull(getJavaEntity().getSequenceGenerator()); + assertEquals(0, CollectionTools.size(getJavaEntity().getPersistenceUnit().allGenerators())); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR); - assertNotNull(javaEntity().getSequenceGenerator()); + assertNotNull(getJavaEntity().getSequenceGenerator()); assertEquals(1, typeResource.supportingAnnotationsSize()); - assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(getJavaEntity().getPersistenceUnit().allGenerators())); - javaEntity().getSequenceGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); + getJavaEntity().getSequenceGenerator().setName("foo"); + assertEquals(1, CollectionTools.size(getJavaEntity().getPersistenceUnit().allGenerators())); } public void testAddSequenceGenerator() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getSequenceGenerator()); + assertNull(getJavaEntity().getSequenceGenerator()); - javaEntity().addSequenceGenerator(); + getJavaEntity().addSequenceGenerator(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNotNull(typeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR)); - assertNotNull(javaEntity().getSequenceGenerator()); + assertNotNull(getJavaEntity().getSequenceGenerator()); //try adding another sequence generator, should get an IllegalStateException try { - javaEntity().addSequenceGenerator(); + getJavaEntity().addSequenceGenerator(); } catch (IllegalStateException e) { return; } @@ -1114,17 +1114,17 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR); - javaEntity().removeSequenceGenerator(); + getJavaEntity().removeSequenceGenerator(); - assertNull(javaEntity().getSequenceGenerator()); + assertNull(getJavaEntity().getSequenceGenerator()); assertNull(typeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR)); //try removing the sequence generator again, should get an IllegalStateException try { - javaEntity().removeSequenceGenerator(); + getJavaEntity().removeSequenceGenerator(); } catch (IllegalStateException e) { return; } @@ -1135,36 +1135,36 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getTableGenerator()); - assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); + assertNull(getJavaEntity().getTableGenerator()); + assertEquals(0, CollectionTools.size(getJavaEntity().getPersistenceUnit().allGenerators())); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR); - assertNotNull(javaEntity().getTableGenerator()); + assertNotNull(getJavaEntity().getTableGenerator()); assertEquals(1, typeResource.supportingAnnotationsSize()); - assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(getJavaEntity().getPersistenceUnit().allGenerators())); - javaEntity().getTableGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); + getJavaEntity().getTableGenerator().setName("foo"); + assertEquals(1, CollectionTools.size(getJavaEntity().getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getTableGenerator()); + assertNull(getJavaEntity().getTableGenerator()); - javaEntity().addTableGenerator(); + getJavaEntity().addTableGenerator(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNotNull(typeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR)); - assertNotNull(javaEntity().getTableGenerator()); + assertNotNull(getJavaEntity().getTableGenerator()); //try adding another table generator, should get an IllegalStateException try { - javaEntity().addTableGenerator(); + getJavaEntity().addTableGenerator(); } catch (IllegalStateException e) { return; } @@ -1175,17 +1175,17 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR); - javaEntity().removeTableGenerator(); + getJavaEntity().removeTableGenerator(); - assertNull(javaEntity().getTableGenerator()); + assertNull(getJavaEntity().getTableGenerator()); assertNull(typeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR)); //try removing the table generator again, should get an IllegalStateException try { - javaEntity().removeTableGenerator(); + getJavaEntity().removeTableGenerator(); } catch (IllegalStateException e) { return; } @@ -1196,43 +1196,43 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNotNull(javaEntity().getDiscriminatorColumn()); + assertNotNull(getJavaEntity().getDiscriminatorColumn()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) typeResource.addSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); column.setName("foo"); - assertEquals("foo", javaEntity().getDiscriminatorColumn().getSpecifiedName()); + assertEquals("foo", getJavaEntity().getDiscriminatorColumn().getSpecifiedName()); column.setName(null); - assertNull(javaEntity().getDiscriminatorColumn().getSpecifiedName()); + assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName()); typeResource.removeSupportingAnnotation(JPA.DISCRIMINATOR_COLUMN); - assertNotNull(javaEntity().getDiscriminatorColumn()); + assertNotNull(getJavaEntity().getDiscriminatorColumn()); } public void testSpecifiedPrimaryKeyJoinColumns() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertFalse(specifiedPkJoinColumns.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); //add an annotation to the resource model and verify the context model is updated PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS); pkJoinColumn.setName("FOO"); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); assertFalse(specifiedPkJoinColumns.hasNext()); pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS); pkJoinColumn.setName("BAR"); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("BAR", specifiedPkJoinColumns.next().getName()); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); assertFalse(specifiedPkJoinColumns.hasNext()); @@ -1240,7 +1240,7 @@ public class JavaEntityTests extends ContextModelTestCase pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS); pkJoinColumn.setName("BAZ"); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("BAZ", specifiedPkJoinColumns.next().getName()); assertEquals("BAR", specifiedPkJoinColumns.next().getName()); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); @@ -1248,26 +1248,26 @@ public class JavaEntityTests extends ContextModelTestCase //move an annotation to the resource model and verify the context model is updated typeResource.moveSupportingAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMNS); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("BAR", specifiedPkJoinColumns.next().getName()); assertEquals("BAZ", specifiedPkJoinColumns.next().getName()); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); assertFalse(specifiedPkJoinColumns.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("BAZ", specifiedPkJoinColumns.next().getName()); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); assertFalse(specifiedPkJoinColumns.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); assertFalse(specifiedPkJoinColumns.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS); - specifiedPkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + specifiedPkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertFalse(specifiedPkJoinColumns.hasNext()); } @@ -1275,13 +1275,13 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(0, javaEntity().specifiedPrimaryKeyJoinColumnsSize()); + assertEquals(0, getJavaEntity().specifiedPrimaryKeyJoinColumnsSize()); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); - assertEquals(3, javaEntity().specifiedPrimaryKeyJoinColumnsSize()); + assertEquals(3, getJavaEntity().specifiedPrimaryKeyJoinColumnsSize()); } public void testPrimaryKeyJoinColumnsSize() throws Exception { @@ -1289,38 +1289,38 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); //just the default pkJoinColumn, so 1 - assertEquals(1, javaEntity().primaryKeyJoinColumnsSize()); + assertEquals(1, getJavaEntity().primaryKeyJoinColumnsSize()); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); //only the specified pkJoinColumns, 3 - assertEquals(3, javaEntity().primaryKeyJoinColumnsSize()); + assertEquals(3, getJavaEntity().primaryKeyJoinColumnsSize()); } public void testGetDefaultPrimaryKeyJoinColumn() throws Exception { createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNotNull(javaEntity().getDefaultPrimaryKeyJoinColumn()); + assertNotNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn()); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); - assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn()); + assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn()); } public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); Iterator<NestableAnnotation> pkJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName()); @@ -1333,11 +1333,11 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); Iterator<NestableAnnotation> pkJoinColumns = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName()); @@ -1349,41 +1349,41 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME))); - javaEntity().removeSpecifiedPrimaryKeyJoinColumn(1); + getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(1); Iterator<NestableAnnotation> pkJoinColumnResources = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName()); assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName()); assertFalse(pkJoinColumnResources.hasNext()); - Iterator<PrimaryKeyJoinColumn> pkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + Iterator<PrimaryKeyJoinColumn> pkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("FOO", pkJoinColumns.next().getName()); assertEquals("BAZ", pkJoinColumns.next().getName()); assertFalse(pkJoinColumns.hasNext()); - javaEntity().removeSpecifiedPrimaryKeyJoinColumn(1); + getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(1); pkJoinColumnResources = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName()); assertFalse(pkJoinColumnResources.hasNext()); - pkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + pkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertEquals("FOO", pkJoinColumns.next().getName()); assertFalse(pkJoinColumns.hasNext()); - javaEntity().removeSpecifiedPrimaryKeyJoinColumn(0); + getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(0); pkJoinColumnResources = typeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); assertFalse(pkJoinColumnResources.hasNext()); - pkJoinColumns = javaEntity().specifiedPrimaryKeyJoinColumns(); + pkJoinColumns = getJavaEntity().specifiedPrimaryKeyJoinColumns(); assertFalse(pkJoinColumns.hasNext()); assertNull(typeResource.getSupportingAnnotation(PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)); @@ -1393,8 +1393,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); entity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); @@ -1432,8 +1432,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); ((PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); ((PrimaryKeyJoinColumnAnnotation) typeResource.addSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -1479,32 +1479,32 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertTrue(javaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual()); + assertTrue(getJavaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual()); - javaEntity().addSpecifiedPrimaryKeyJoinColumn(0); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertFalse(specifiedPkJoinColumn.isVirtual()); - assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn()); + assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn()); } public void testTableNameIsInvalid() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertFalse(javaEntity().tableNameIsInvalid(TYPE_NAME)); - assertTrue(javaEntity().tableNameIsInvalid("FOO")); + assertFalse(getJavaEntity().tableNameIsInvalid(TYPE_NAME)); + assertTrue(getJavaEntity().tableNameIsInvalid("FOO")); - javaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR"); + getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR"); - assertFalse(javaEntity().tableNameIsInvalid("BAR")); + assertFalse(getJavaEntity().tableNameIsInvalid("BAR")); } public void testAttributeMappingKeyAllowed() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = (Entity) javaPersistentType().getMapping(); + Entity entity = (Entity) getJavaPersistentType().getMapping(); assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY)); assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)); assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY)); @@ -1521,7 +1521,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<PersistentAttribute> overridableAttributes = javaEntity().overridableAttributes(); + Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().overridableAttributes(); assertFalse(overridableAttributes.hasNext()); } @@ -1529,7 +1529,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<String> overridableAttributeNames = javaEntity().overridableAttributeNames(); + Iterator<String> overridableAttributeNames = getJavaEntity().overridableAttributeNames(); assertFalse(overridableAttributeNames.hasNext()); } @@ -1539,7 +1539,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<PersistentAttribute> overridableAttributes = javaEntity().allOverridableAttributes(); + Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().allOverridableAttributes(); assertEquals("id", overridableAttributes.next().getName()); assertEquals("name", overridableAttributes.next().getName()); assertEquals("foo", overridableAttributes.next().getName()); @@ -1550,9 +1550,9 @@ public class JavaEntityTests extends ContextModelTestCase createTestMappedSuperclass(); createTestSubType(); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - Iterator<PersistentAttribute> overridableAttributes = javaEntity().allOverridableAttributes(); + Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().allOverridableAttributes(); assertEquals("id", overridableAttributes.next().getName()); assertEquals("name", overridableAttributes.next().getName()); assertEquals("foo", overridableAttributes.next().getName()); @@ -1565,7 +1565,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<String> overridableAttributeNames = javaEntity().allOverridableAttributeNames(); + Iterator<String> overridableAttributeNames = getJavaEntity().allOverridableAttributeNames(); assertEquals("id", overridableAttributeNames.next()); assertEquals("name", overridableAttributeNames.next()); assertEquals("foo", overridableAttributeNames.next()); @@ -1576,22 +1576,22 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertFalse(specifiedAttributeOverrides.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); //add an annotation to the resource model and verify the context model is updated AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); attributeOverride.setName("FOO"); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("FOO", specifiedAttributeOverrides.next().getName()); assertFalse(specifiedAttributeOverrides.hasNext()); attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); attributeOverride.setName("BAR"); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("FOO", specifiedAttributeOverrides.next().getName()); assertEquals("BAR", specifiedAttributeOverrides.next().getName()); assertFalse(specifiedAttributeOverrides.hasNext()); @@ -1599,7 +1599,7 @@ public class JavaEntityTests extends ContextModelTestCase attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); attributeOverride.setName("BAZ"); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("BAZ", specifiedAttributeOverrides.next().getName()); assertEquals("FOO", specifiedAttributeOverrides.next().getName()); assertEquals("BAR", specifiedAttributeOverrides.next().getName()); @@ -1607,26 +1607,26 @@ public class JavaEntityTests extends ContextModelTestCase //move an annotation to the resource model and verify the context model is updated typeResource.moveSupportingAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("FOO", specifiedAttributeOverrides.next().getName()); assertEquals("BAZ", specifiedAttributeOverrides.next().getName()); assertEquals("BAR", specifiedAttributeOverrides.next().getName()); assertFalse(specifiedAttributeOverrides.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("BAZ", specifiedAttributeOverrides.next().getName()); assertEquals("BAR", specifiedAttributeOverrides.next().getName()); assertFalse(specifiedAttributeOverrides.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("BAR", specifiedAttributeOverrides.next().getName()); assertFalse(specifiedAttributeOverrides.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); - specifiedAttributeOverrides = javaEntity().specifiedAttributeOverrides(); + specifiedAttributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertFalse(specifiedAttributeOverrides.hasNext()); } @@ -1637,11 +1637,11 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); assertEquals(SUB_TYPE_NAME, typeResource.getName()); assertNull(typeResource.getSupportingAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME)); @@ -1653,7 +1653,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable()); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping(); idMapping.getColumn().setSpecifiedName("FOO"); @@ -1688,9 +1688,9 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(0, javaEntity().specifiedAttributeOverridesSize()); + assertEquals(0, getJavaEntity().specifiedAttributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); //add an annotation to the resource model and verify the context model is updated AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); @@ -1698,7 +1698,7 @@ public class JavaEntityTests extends ContextModelTestCase attributeOverride = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); attributeOverride.setName("BAR"); - assertEquals(2, javaEntity().specifiedAttributeOverridesSize()); + assertEquals(2, getJavaEntity().specifiedAttributeOverridesSize()); } public void testDefaultAttributeOverridesSize() throws Exception { @@ -1707,7 +1707,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity javaEntity = javaEntity(); + Entity javaEntity = getJavaEntity(); assertEquals(3, javaEntity.virtualAttributeOverridesSize()); @@ -1727,7 +1727,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity javaEntity = javaEntity(); + Entity javaEntity = getJavaEntity(); assertEquals(3, javaEntity.attributeOverridesSize()); @@ -1738,7 +1738,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals(3, javaEntity.attributeOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES); annotation.setName("bar"); assertEquals(4, javaEntity.attributeOverridesSize()); @@ -1751,10 +1751,10 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); Iterator<NestableAnnotation> attributeOverrides = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName()); @@ -1769,12 +1769,12 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaAttributeOverride> virtualAttributeOverrides = javaEntity().virtualAttributeOverrides(); + ListIterator<JavaAttributeOverride> virtualAttributeOverrides = getJavaEntity().virtualAttributeOverrides(); virtualAttributeOverrides.next(); virtualAttributeOverrides.next().setVirtual(false); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); Iterator<NestableAnnotation> attributeOverrides = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName()); @@ -1789,40 +1789,40 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); assertEquals(3, CollectionTools.size(typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME))); - javaEntity().specifiedAttributeOverrides().next().setVirtual(true); + getJavaEntity().specifiedAttributeOverrides().next().setVirtual(true); Iterator<NestableAnnotation> attributeOverrideResources = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName()); assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName()); assertFalse(attributeOverrideResources.hasNext()); - Iterator<AttributeOverride> attributeOverrides = javaEntity().specifiedAttributeOverrides(); + Iterator<AttributeOverride> attributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("name", attributeOverrides.next().getName()); assertEquals("foo", attributeOverrides.next().getName()); assertFalse(attributeOverrides.hasNext()); - javaEntity().specifiedAttributeOverrides().next().setVirtual(true); + getJavaEntity().specifiedAttributeOverrides().next().setVirtual(true); attributeOverrideResources = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName()); assertFalse(attributeOverrideResources.hasNext()); - attributeOverrides = javaEntity().specifiedAttributeOverrides(); + attributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertEquals("foo", attributeOverrides.next().getName()); assertFalse(attributeOverrides.hasNext()); - javaEntity().specifiedAttributeOverrides().next().setVirtual(true); + getJavaEntity().specifiedAttributeOverrides().next().setVirtual(true); attributeOverrideResources = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); assertFalse(attributeOverrideResources.hasNext()); - attributeOverrides = javaEntity().specifiedAttributeOverrides(); + attributeOverrides = getJavaEntity().specifiedAttributeOverrides(); assertFalse(attributeOverrides.hasNext()); assertNull(typeResource.getSupportingAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME)); @@ -1835,13 +1835,13 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); + Entity entity = getJavaEntity(); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); ListIterator<NestableAnnotation> javaAttributeOverrides = typeResource.supportingAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME); assertEquals(3, CollectionTools.size(javaAttributeOverrides)); @@ -1875,8 +1875,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); ((AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("FOO"); ((AttributeOverrideAnnotation) typeResource.addSupportingAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -1924,7 +1924,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<AttributeOverride> virtualAttributeOverrides = javaEntity().virtualAttributeOverrides(); + ListIterator<AttributeOverride> virtualAttributeOverrides = getJavaEntity().virtualAttributeOverrides(); AttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next(); assertEquals("id", virtualAttributeOverride.getName()); assertTrue(virtualAttributeOverride.isVirtual()); @@ -1938,12 +1938,12 @@ public class JavaEntityTests extends ContextModelTestCase assertTrue(virtualAttributeOverride.isVirtual()); assertFalse(virtualAttributeOverrides.hasNext()); - javaEntity().virtualAttributeOverrides().next().setVirtual(false); - AttributeOverride specifiedAttributeOverride = javaEntity().specifiedAttributeOverrides().next(); + getJavaEntity().virtualAttributeOverrides().next().setVirtual(false); + AttributeOverride specifiedAttributeOverride = getJavaEntity().specifiedAttributeOverrides().next(); assertFalse(specifiedAttributeOverride.isVirtual()); - virtualAttributeOverrides = javaEntity().virtualAttributeOverrides(); + virtualAttributeOverrides = getJavaEntity().virtualAttributeOverrides(); virtualAttributeOverride = virtualAttributeOverrides.next(); assertEquals("name", virtualAttributeOverride.getName()); assertTrue(virtualAttributeOverride.isVirtual()); @@ -1959,7 +1959,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<PersistentAttribute> overridableAssociations = javaEntity().overridableAssociations(); + Iterator<PersistentAttribute> overridableAssociations = getJavaEntity().overridableAssociations(); assertFalse(overridableAssociations.hasNext()); } @@ -1967,7 +1967,7 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<String> overridableAssociationNames = javaEntity().overridableAssociationNames(); + Iterator<String> overridableAssociationNames = getJavaEntity().overridableAssociationNames(); assertFalse(overridableAssociationNames.hasNext()); } @@ -1978,7 +1978,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<String> overridableAssociationNames = javaEntity().allOverridableAssociationNames(); + Iterator<String> overridableAssociationNames = getJavaEntity().allOverridableAssociationNames(); assertEquals("address", overridableAssociationNames.next()); assertEquals("address2", overridableAssociationNames.next()); assertFalse(overridableAssociationNames.hasNext()); @@ -1990,7 +1990,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<PersistentAttribute> overridableAssociations = javaEntity().allOverridableAssociations(); + Iterator<PersistentAttribute> overridableAssociations = getJavaEntity().allOverridableAssociations(); assertEquals("address", overridableAssociations.next().getName()); assertEquals("address2", overridableAssociations.next().getName()); assertFalse(overridableAssociations.hasNext()); @@ -2000,9 +2000,9 @@ public class JavaEntityTests extends ContextModelTestCase createTestMappedSuperclass(); createTestSubType(); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - Iterator<PersistentAttribute> overridableAssociations = javaEntity().allOverridableAssociations(); + Iterator<PersistentAttribute> overridableAssociations = getJavaEntity().allOverridableAssociations(); assertEquals("address", overridableAssociations.next().getName()); assertEquals("address2", overridableAssociations.next().getName()); assertFalse(overridableAssociations.hasNext()); @@ -2012,22 +2012,22 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertFalse(specifiedAssociationOverrides.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); //add an annotation to the resource model and verify the context model is updated AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); associationOverride.setName("FOO"); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("FOO", specifiedAssociationOverrides.next().getName()); assertFalse(specifiedAssociationOverrides.hasNext()); associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); associationOverride.setName("BAR"); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("FOO", specifiedAssociationOverrides.next().getName()); assertEquals("BAR", specifiedAssociationOverrides.next().getName()); assertFalse(specifiedAssociationOverrides.hasNext()); @@ -2035,7 +2035,7 @@ public class JavaEntityTests extends ContextModelTestCase associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); associationOverride.setName("BAZ"); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("BAZ", specifiedAssociationOverrides.next().getName()); assertEquals("FOO", specifiedAssociationOverrides.next().getName()); assertEquals("BAR", specifiedAssociationOverrides.next().getName()); @@ -2043,26 +2043,26 @@ public class JavaEntityTests extends ContextModelTestCase //move an annotation to the resource model and verify the context model is updated typeResource.moveSupportingAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDES); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("FOO", specifiedAssociationOverrides.next().getName()); assertEquals("BAZ", specifiedAssociationOverrides.next().getName()); assertEquals("BAR", specifiedAssociationOverrides.next().getName()); assertFalse(specifiedAssociationOverrides.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("BAZ", specifiedAssociationOverrides.next().getName()); assertEquals("BAR", specifiedAssociationOverrides.next().getName()); assertFalse(specifiedAssociationOverrides.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("BAR", specifiedAssociationOverrides.next().getName()); assertFalse(specifiedAssociationOverrides.hasNext()); typeResource.removeSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); - specifiedAssociationOverrides = javaEntity().specifiedAssociationOverrides(); + specifiedAssociationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertFalse(specifiedAssociationOverrides.hasNext()); } @@ -2073,11 +2073,11 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); assertEquals(SUB_TYPE_NAME, typeResource.getName()); assertNull(typeResource.getSupportingAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME)); @@ -2161,9 +2161,9 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(0, javaEntity().specifiedAssociationOverridesSize()); + assertEquals(0, getJavaEntity().specifiedAssociationOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); //add an annotation to the resource model and verify the context model is updated AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); @@ -2171,7 +2171,7 @@ public class JavaEntityTests extends ContextModelTestCase associationOverride = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); associationOverride.setName("BAR"); - assertEquals(2, javaEntity().specifiedAssociationOverridesSize()); + assertEquals(2, getJavaEntity().specifiedAssociationOverridesSize()); } public void testDefaultAssociationOverridesSize() throws Exception { @@ -2180,7 +2180,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity javaEntity = javaEntity(); + Entity javaEntity = getJavaEntity(); assertEquals(2, javaEntity.virtualAssociationOverridesSize()); @@ -2197,7 +2197,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity javaEntity = javaEntity(); + Entity javaEntity = getJavaEntity(); assertEquals(2, javaEntity.associationOverridesSize()); @@ -2208,7 +2208,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals(2, javaEntity.associationOverridesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES); annotation.setName("bar"); assertEquals(3, javaEntity.associationOverridesSize()); @@ -2221,10 +2221,10 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); Iterator<NestableAnnotation> associationOverrides = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME); assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName()); @@ -2239,12 +2239,12 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaAssociationOverride> virtualAssociationOverrides = javaEntity().virtualAssociationOverrides(); + ListIterator<JavaAssociationOverride> virtualAssociationOverrides = getJavaEntity().virtualAssociationOverrides(); virtualAssociationOverrides.next(); virtualAssociationOverrides.next().setVirtual(false); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); Iterator<NestableAnnotation> associationOverrides = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME); assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName()); @@ -2259,27 +2259,27 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); assertEquals(2, CollectionTools.size(typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME))); - javaEntity().specifiedAssociationOverrides().next().setVirtual(true); + getJavaEntity().specifiedAssociationOverrides().next().setVirtual(true); Iterator<NestableAnnotation> associationOverrideResources = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME); assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName()); assertFalse(associationOverrideResources.hasNext()); - Iterator<AssociationOverride> associationOverrides = javaEntity().specifiedAssociationOverrides(); + Iterator<AssociationOverride> associationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertEquals("address2", associationOverrides.next().getName()); assertFalse(associationOverrides.hasNext()); - javaEntity().specifiedAssociationOverrides().next().setVirtual(true); + getJavaEntity().specifiedAssociationOverrides().next().setVirtual(true); associationOverrideResources = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME); assertFalse(associationOverrideResources.hasNext()); - associationOverrides = javaEntity().specifiedAssociationOverrides(); + associationOverrides = getJavaEntity().specifiedAssociationOverrides(); assertFalse(associationOverrides.hasNext()); assertNull(typeResource.getSupportingAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME)); @@ -2292,12 +2292,12 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); + Entity entity = getJavaEntity(); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME); ListIterator<NestableAnnotation> javaAssociationOverrides = typeResource.supportingAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME); assertEquals(2, CollectionTools.size(javaAssociationOverrides)); @@ -2327,8 +2327,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); ((AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("FOO"); ((AssociationOverrideAnnotation) typeResource.addSupportingAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -2376,7 +2376,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<AssociationOverride> virtualAssociationOverrides = javaEntity().virtualAssociationOverrides(); + ListIterator<AssociationOverride> virtualAssociationOverrides = getJavaEntity().virtualAssociationOverrides(); AssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next(); assertEquals("address", virtualAssociationOverride.getName()); assertTrue(virtualAssociationOverride.isVirtual()); @@ -2386,12 +2386,12 @@ public class JavaEntityTests extends ContextModelTestCase assertTrue(virtualAssociationOverride.isVirtual()); assertFalse(virtualAssociationOverrides.hasNext()); - javaEntity().virtualAssociationOverrides().next().setVirtual(false); - AssociationOverride specifiedAssociationOverride = javaEntity().specifiedAssociationOverrides().next(); + getJavaEntity().virtualAssociationOverrides().next().setVirtual(false); + AssociationOverride specifiedAssociationOverride = getJavaEntity().specifiedAssociationOverrides().next(); assertFalse(specifiedAssociationOverride.isVirtual()); - virtualAssociationOverrides = javaEntity().virtualAssociationOverrides(); + virtualAssociationOverrides = getJavaEntity().virtualAssociationOverrides(); virtualAssociationOverride = virtualAssociationOverrides.next(); assertEquals("address2", virtualAssociationOverride.getName()); assertTrue(virtualAssociationOverride.isVirtual()); @@ -2402,8 +2402,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQuery namedQuery = entity.addNamedQuery(0); namedQuery.setName("FOO"); @@ -2443,8 +2443,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addNamedQuery(0).setName("FOO"); entity.addNamedQuery(1).setName("BAR"); @@ -2475,8 +2475,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addNamedQuery(0).setName("FOO"); @@ -2492,8 +2492,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addNamedNativeQuery(0).setName("FOO"); @@ -2509,8 +2509,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addNamedQuery(0).setName("FOO"); entity.addNamedQuery(1).setName("BAR"); @@ -2548,8 +2548,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries())); @@ -2600,8 +2600,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(0, entity.namedQueriesSize()); @@ -2616,8 +2616,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQuery namedNativeQuery = entity.addNamedNativeQuery(0); namedNativeQuery.setName("FOO"); @@ -2655,8 +2655,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addNamedNativeQuery(0).setName("FOO"); entity.addNamedNativeQuery(1).setName("BAR"); @@ -2687,8 +2687,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); entity.addNamedNativeQuery(0).setName("FOO"); entity.addNamedNativeQuery(1).setName("BAR"); @@ -2726,8 +2726,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries())); @@ -2778,8 +2778,8 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Entity entity = getJavaEntity(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertEquals(0, entity.namedNativeQueriesSize()); @@ -2794,22 +2794,22 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getIdClass()); + assertNull(getJavaEntity().getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); IdClassAnnotation idClass = (IdClassAnnotation) typeResource.addSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME); - assertNull(javaEntity().getIdClass()); + assertNull(getJavaEntity().getIdClass()); assertNotNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); idClass.setValue("model.Foo"); - assertEquals("model.Foo", javaEntity().getIdClass()); + assertEquals("model.Foo", getJavaEntity().getIdClass()); assertEquals("model.Foo", ((IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue()); //test setting @IdClass value to null, IdClass annotation is removed idClass.setValue(null); - assertNull(javaEntity().getIdClass()); + assertNull(getJavaEntity().getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); //reset @IdClass value and then remove @IdClass @@ -2817,7 +2817,7 @@ public class JavaEntityTests extends ContextModelTestCase idClass.setValue("model.Foo"); typeResource.removeSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME); - assertNull(javaEntity().getIdClass()); + assertNull(getJavaEntity().getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); } @@ -2825,17 +2825,17 @@ public class JavaEntityTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getIdClass()); + assertNull(getJavaEntity().getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); - javaEntity().setIdClass("model.Foo"); + getJavaEntity().setIdClass("model.Foo"); assertEquals("model.Foo", ((IdClassAnnotation) typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue()); - assertEquals("model.Foo", javaEntity().getIdClass()); + assertEquals("model.Foo", getJavaEntity().getIdClass()); - javaEntity().setIdClass(null); - assertNull(javaEntity().getIdClass()); + getJavaEntity().setIdClass(null); + assertNull(getJavaEntity().getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); } @@ -2845,7 +2845,7 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Iterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + Iterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); JavaPersistentType entityPersistentType = classRefs.next().getJavaPersistentType(); JavaEntity javaEntity = (JavaEntity) entityPersistentType.getMapping(); JavaPersistentType mappedSuperclassPersistentType = classRefs.next().getJavaPersistentType(); @@ -2869,12 +2869,12 @@ public class JavaEntityTests extends ContextModelTestCase public void testDiscriminatorValueIsAllowedConcreteClass() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertTrue(javaEntity().isDiscriminatorValueAllowed()); + assertTrue(getJavaEntity().isDiscriminatorValueAllowed()); } public void testDiscriminatorValueIsAllowedAbstractClass() throws Exception { createTestAbstractEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertFalse(javaEntity().isDiscriminatorValueAllowed()); + assertFalse(getJavaEntity().isDiscriminatorValueAllowed()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java index 9f5600a506..38f306f140 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaGeneratedValueTests.java @@ -53,11 +53,11 @@ public class JavaGeneratedValueTests extends ContextModelTestCase createTestEntityWithGeneratedValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator()); //change resource model sequenceGenerator name, verify the context model is updated - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE); @@ -70,14 +70,14 @@ public class JavaGeneratedValueTests extends ContextModelTestCase createTestEntityWithGeneratedValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator()); idMapping.getGeneratedValue().setSpecifiedGenerator("foo"); assertEquals("foo", idMapping.getGeneratedValue().getGenerator()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE); @@ -88,14 +88,14 @@ public class JavaGeneratedValueTests extends ContextModelTestCase createTestEntityWithGeneratedValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator()); idMapping.getGeneratedValue().setSpecifiedGenerator(null); assertNotNull(idMapping.getGeneratedValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE); @@ -106,11 +106,11 @@ public class JavaGeneratedValueTests extends ContextModelTestCase createTestEntityWithGeneratedValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy()); //change resource model sequenceGenerator name, verify the context model is updated - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE); @@ -124,14 +124,14 @@ public class JavaGeneratedValueTests extends ContextModelTestCase createTestEntityWithGeneratedValue(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy()); idMapping.getGeneratedValue().setSpecifiedStrategy(GenerationType.IDENTITY); assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java index 159463b06e..ec647e92af 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java @@ -115,7 +115,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -130,7 +130,7 @@ public class JavaIdMappingTests extends ContextModelTestCase assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName()); assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -145,7 +145,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -160,7 +160,7 @@ public class JavaIdMappingTests extends ContextModelTestCase assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName()); assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME)); @@ -174,7 +174,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -189,7 +189,7 @@ public class JavaIdMappingTests extends ContextModelTestCase assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName()); assertEquals(TemporalType.TIME, ((TemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); @@ -204,7 +204,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -218,7 +218,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -233,7 +233,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -247,7 +247,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof TransientMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); @@ -262,7 +262,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -276,7 +276,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -291,7 +291,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -305,7 +305,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); @@ -320,7 +320,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -334,7 +334,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); @@ -349,7 +349,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -363,7 +363,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); @@ -378,7 +378,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getMapping(); assertFalse(idMapping.isDefault()); idMapping.getColumn().setSpecifiedName("FOO"); @@ -392,7 +392,7 @@ public class JavaIdMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); @@ -407,7 +407,7 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithTemporal(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) idMapping.getConverter()).getTemporalType()); @@ -417,14 +417,14 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType()); idMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER); ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); @@ -438,13 +438,13 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); temporal.setValue(org.eclipse.jpt.core.resource.java.TemporalType.DATE); @@ -462,13 +462,13 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getColumn().getSpecifiedName()); assertEquals("id", idMapping.getColumn().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setName("foo"); @@ -482,12 +482,12 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getSequenceGenerator()); assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR); assertNotNull(idMapping.getSequenceGenerator()); @@ -502,14 +502,14 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getSequenceGenerator()); idMapping.addSequenceGenerator(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR)); @@ -528,10 +528,10 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -554,12 +554,12 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getTableGenerator()); assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR); assertNotNull(idMapping.getTableGenerator()); @@ -574,14 +574,14 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getTableGenerator()); idMapping.addTableGenerator(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR)); @@ -600,10 +600,10 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -626,12 +626,12 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getGeneratedValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(JPA.GENERATED_VALUE); @@ -643,10 +643,10 @@ public class JavaIdMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); createTestEntityWithIdMappingGeneratedValue(); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(idMapping.getGeneratedValue()); @@ -657,14 +657,14 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getGeneratedValue()); idMapping.addGeneratedValue(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(attributeResource.getSupportingAnnotation(JPA.GENERATED_VALUE)); @@ -683,10 +683,10 @@ public class JavaIdMappingTests extends ContextModelTestCase createTestEntityWithIdMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.addSupportingAnnotation(JPA.GENERATED_VALUE); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java index 6147229043..3d357fecf8 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java @@ -91,9 +91,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -119,8 +119,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -146,7 +146,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); JavaJoinColumn defaultJavaJoinColumn = oneToOneMapping.getDefaultJoinColumn(); // assertNull(defaultJavaJoinColumn.getDefaultName()); @@ -185,9 +185,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -214,8 +214,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -243,9 +243,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -272,8 +272,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -301,9 +301,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -330,8 +330,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -354,9 +354,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -383,8 +383,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -407,9 +407,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -436,8 +436,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -460,9 +460,9 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME); @@ -489,8 +489,8 @@ public class JavaJoinColumnTests extends ContextModelTestCase createTestEntityWithOneToOne(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) javaPersistentType().attributes().next().getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java index da71cb5030..cce4bb90b4 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java @@ -95,10 +95,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -132,10 +132,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -160,7 +160,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); //joinTable default name is null because targetEntity is not in the persistence unit @@ -171,7 +171,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".Project"); assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME)); @@ -193,7 +193,7 @@ public class JavaJoinTableTests extends ContextModelTestCase assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName()); //set a table on the owning entity, very default join table name updates - javaEntity().getTable().setSpecifiedName("BAR"); + getJavaEntity().getTable().setSpecifiedName("BAR"); assertEquals("BAR_FOO", joinTable.getDefaultName()); } @@ -201,10 +201,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -238,10 +238,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -265,10 +265,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -302,10 +302,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -329,10 +329,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -371,10 +371,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -401,10 +401,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -441,10 +441,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -500,7 +500,7 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); assertEquals(0, joinTable.specifiedJoinColumnsSize()); @@ -516,7 +516,7 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); assertEquals(1, joinTable.joinColumnsSize()); @@ -540,10 +540,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -582,10 +582,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO"); @@ -612,10 +612,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO"); @@ -652,10 +652,10 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableResource = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -711,7 +711,7 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); assertEquals(0, joinTable.specifiedInverseJoinColumnsSize()); @@ -727,7 +727,7 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping(); + JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); JoinTable joinTable = manyToManyMapping.getJoinTable(); assertEquals(1, joinTable.inverseJoinColumnsSize()); @@ -751,12 +751,12 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); ListIterator<JavaUniqueConstraint> uniqueConstraints = joinTable.uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); @@ -773,11 +773,11 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); assertEquals(0, joinTable.uniqueConstraintsSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); @@ -790,12 +790,12 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(0).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.uniqueConstraints(); @@ -810,12 +810,12 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.uniqueConstraints(); @@ -830,12 +830,12 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -875,12 +875,12 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); @@ -915,8 +915,8 @@ public class JavaJoinTableTests extends ContextModelTestCase createTestEntityWithManyToMany(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JoinTable joinTable = ((JavaManyToManyMapping) javaPersistentType().attributes().next().getMapping()).getJoinTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JoinTable joinTable = ((JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping()).getJoinTable(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java index d515236b80..4ec3ed4b4d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java @@ -224,7 +224,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -234,7 +234,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -246,7 +246,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -256,7 +256,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertNull(persistentAttribute.getSpecifiedMapping()); assertTrue(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME)); @@ -267,7 +267,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -277,7 +277,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof VersionMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); @@ -289,7 +289,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -299,7 +299,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof IdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -311,7 +311,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -321,7 +321,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -333,7 +333,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -343,7 +343,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -355,7 +355,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -365,7 +365,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof TransientMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); @@ -377,7 +377,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -387,7 +387,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); @@ -399,7 +399,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -409,7 +409,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); @@ -421,7 +421,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.setOrderBy("asdf"); manyToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -431,7 +431,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); @@ -443,10 +443,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -468,10 +468,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -493,10 +493,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -523,10 +523,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -553,10 +553,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -578,10 +578,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -606,7 +606,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator<String> attributeNames = manyToManyMapping.candidateMappedByAttributeNames(); @@ -634,7 +634,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit, default still set, handled by validation @@ -648,7 +648,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase manyToManyMapping.setSpecifiedTargetEntity("foo"); assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity()); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType(); @@ -664,7 +664,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); assertNull(manyToManyMapping.getDefaultTargetEntity()); @@ -676,7 +676,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); assertNull(manyToManyMapping.getDefaultTargetEntity()); @@ -687,7 +687,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity()); @@ -703,7 +703,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithValidManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit @@ -712,7 +712,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase //add targetEntity to the persistence unit, now target entity should resolve createTestTargetEntityAddress(); addXmlClassRef(PACKAGE_NAME + ".Address"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping(); @@ -736,10 +736,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(manyToManyMapping.getMapKey()); @@ -771,10 +771,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(manyToManyMapping.getMapKey()); @@ -796,10 +796,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(manyToManyMapping.getOrderBy()); @@ -822,10 +822,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(manyToManyMapping.getOrderBy()); @@ -847,10 +847,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertTrue(manyToManyMapping.isNoOrdering()); @@ -874,10 +874,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertTrue(manyToManyMapping.isNoOrdering()); @@ -900,10 +900,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(manyToManyMapping.isPkOrdering()); @@ -927,10 +927,10 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase createTestEntityWithManyToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(manyToManyMapping.isCustomOrdering()); @@ -956,7 +956,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".Department"); addXmlClassRef(PACKAGE_NAME + ".Employee"); - JavaPersistentType departmentPersistentType = javaPersistentType(); + JavaPersistentType departmentPersistentType = getJavaPersistentType(); ManyToManyMapping employeesMapping = (ManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getSpecifiedMapping(); assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java index 7bc46eca6c..f1e4f944c7 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java @@ -179,7 +179,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -188,7 +188,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -199,7 +199,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -208,7 +208,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertNull(persistentAttribute.getSpecifiedMapping()); assertTrue(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME)); @@ -218,7 +218,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -227,7 +227,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof VersionMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); @@ -238,7 +238,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -247,7 +247,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof IdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -258,7 +258,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -267,7 +267,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -278,7 +278,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -287,7 +287,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -298,7 +298,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -307,7 +307,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof TransientMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); @@ -318,7 +318,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -327,7 +327,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); @@ -338,7 +338,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -347,7 +347,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); @@ -358,7 +358,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -367,7 +367,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); @@ -378,10 +378,10 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -403,10 +403,10 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -428,10 +428,10 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -458,10 +458,10 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -489,14 +489,14 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); ListIterator<JavaJoinColumn> specifiedJoinColumns = manyToOneMapping.specifiedJoinColumns(); assertFalse(specifiedJoinColumns.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -555,7 +555,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); assertEquals(0, manyToOneMapping.specifiedJoinColumnsSize()); @@ -571,7 +571,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); assertEquals(1, manyToOneMapping.joinColumnsSize()); @@ -591,14 +591,14 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAR"); manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME); @@ -612,14 +612,14 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); manyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); manyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME); @@ -632,14 +632,14 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); manyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); manyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME))); @@ -680,14 +680,14 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); manyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); manyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); manyToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); + JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ListIterator<NestableAnnotation> javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME); assertEquals(3, CollectionTools.size(javaJoinColumns)); @@ -721,9 +721,9 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); + JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -768,7 +768,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); assertTrue(manyToOneMapping.getDefaultJoinColumn().isVirtual()); @@ -785,7 +785,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit, default still set, handled by validation @@ -799,7 +799,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase manyToOneMapping.setSpecifiedTargetEntity("foo"); assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity()); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType(); @@ -815,7 +815,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); assertNull(manyToOneMapping.getDefaultTargetEntity()); @@ -827,7 +827,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); assertNull(manyToOneMapping.getDefaultTargetEntity()); @@ -839,7 +839,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity()); @@ -855,7 +855,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase createTestEntityWithValidManyToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit @@ -864,7 +864,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase //add targetEntity to the persistence unit, now target entity should resolve createTestTargetEntityAddress(); addXmlClassRef(PACKAGE_NAME + ".Address"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java index 8991ebee5f..d951c22f56 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaMappedSuperclassTests.java @@ -48,13 +48,13 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); mappedSuperclass.setIdClass("myIdClass"); - javaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof Entity); + getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof Entity); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME)); assertNotNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); } @@ -63,13 +63,13 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); mappedSuperclass.setIdClass("myIdClass"); - javaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof Embeddable); + getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); } @@ -78,13 +78,13 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); mappedSuperclass.setIdClass("myIdClass"); - javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); - assertTrue(javaPersistentType().getMapping() instanceof JavaNullTypeMapping); + getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); + assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME)); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); } @@ -93,14 +93,14 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase public void testMappedSuperclass() throws Exception { createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertTrue(javaPersistentType().getMapping() instanceof MappedSuperclass); + assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass); } public void testOverridableAttributeNames() throws Exception { createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); Iterator<String> overridableAttributeNames = mappedSuperclass.overridableAttributeNames(); assertEquals("id", overridableAttributeNames.next()); assertEquals("name", overridableAttributeNames.next()); @@ -111,7 +111,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); Iterator<String> overridableAssociationNames = mappedSuperclass.overridableAssociationNames(); assertFalse(overridableAssociationNames.hasNext()); } @@ -120,7 +120,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertFalse(mappedSuperclass.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME)); assertFalse(mappedSuperclass.tableNameIsInvalid("FOO")); @@ -130,7 +130,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertFalse(mappedSuperclass.associatedTables().hasNext()); } @@ -139,7 +139,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertFalse(mappedSuperclass.associatedTablesIncludingInherited().hasNext()); } @@ -148,7 +148,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertFalse(mappedSuperclass.associatedTableNamesIncludingInherited().hasNext()); } @@ -157,7 +157,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); Iterator<String> overridableAttributeNames = mappedSuperclass.overridableAttributeNames(); assertEquals("id", overridableAttributeNames.next()); assertEquals("name", overridableAttributeNames.next()); @@ -169,7 +169,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); Iterator<String> overridableAssociationNames = mappedSuperclass.overridableAssociationNames(); assertFalse(overridableAssociationNames.hasNext()); } @@ -178,7 +178,7 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY)); assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)); assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY)); @@ -195,8 +195,8 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertNull(mappedSuperclass.getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); @@ -227,8 +227,8 @@ public class JavaMappedSuperclassTests extends ContextModelTestCase createTestMappedSuperclass(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); - MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping(); assertNull(mappedSuperclass.getIdClass()); assertNull(typeResource.getSupportingAnnotation(IdClassAnnotation.ANNOTATION_NAME)); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java index 1ed5f7fa7c..43d48878d6 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedNativeQueryTests.java @@ -50,10 +50,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_NAME, javaNamedNativeQuery.getName()); @@ -73,10 +73,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testModifyName() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_NAME, javaNamedNativeQuery.getName()); @@ -97,10 +97,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery()); @@ -120,10 +120,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testModifyQuery() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery()); @@ -144,32 +144,32 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testAddHint() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); QueryHint queryHint = namedNativeQuery.addHint(0); - ormResource().save(null); + getOrmResource().save(null); queryHint.setName("FOO"); - ormResource().save(null); + getOrmResource().save(null); assertEquals("FOO", javaNamedNativeQuery.hintAt(0).getName()); QueryHint queryHint2 = namedNativeQuery.addHint(0); - ormResource().save(null); + getOrmResource().save(null); queryHint2.setName("BAR"); - ormResource().save(null); + getOrmResource().save(null); assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName()); assertEquals("FOO", javaNamedNativeQuery.hintAt(1).getName()); QueryHint queryHint3 = namedNativeQuery.addHint(1); - ormResource().save(null); + getOrmResource().save(null); queryHint3.setName("BAZ"); - ormResource().save(null); + getOrmResource().save(null); assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName()); assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName()); @@ -189,10 +189,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testRemoveHint() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); namedNativeQuery.addHint(0).setName("FOO"); @@ -217,10 +217,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testMoveHint() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); namedNativeQuery.addHint(0).setName("FOO"); @@ -255,10 +255,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testUpdateHints() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); javaNamedNativeQuery.addHint(0); @@ -307,12 +307,12 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testHintsSize() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); assertEquals(0, namedNativeQuery.hintsSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); @@ -331,10 +331,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(null, javaNamedNativeQuery.getResultClass()); @@ -354,10 +354,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testModifyResultClass() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(null, javaNamedNativeQuery.getResultClass()); @@ -378,10 +378,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(null, javaNamedNativeQuery.getResultSetMapping()); @@ -401,10 +401,10 @@ public class JavaNamedNativeQueryTests extends ContextModelTestCase public void testModifyResultSetMapping() throws Exception { createTestEntityWithNamedNativeQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedNativeQuery namedNativeQuery = entity.namedNativeQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) typeResource.getSupportingAnnotation(NamedNativeQueryAnnotation.ANNOTATION_NAME); assertEquals(null, javaNamedNativeQuery.getResultSetMapping()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java index e792f45a10..bebc76ee08 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaNamedQueryTests.java @@ -50,10 +50,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_NAME, javaNamedQuery.getName()); @@ -73,10 +73,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testModifyName() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_NAME, javaNamedQuery.getName()); @@ -97,10 +97,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_QUERY, javaNamedQuery.getQuery()); @@ -120,10 +120,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testModifyQuery() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); assertEquals(QUERY_QUERY, javaNamedQuery.getQuery()); @@ -144,10 +144,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testAddHint() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); @@ -183,10 +183,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testRemoveHint() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); namedQuery.addHint(0).setName("FOO"); @@ -211,10 +211,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testMoveHint() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); namedQuery.addHint(0).setName("FOO"); @@ -249,10 +249,10 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testUpdateHints() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); javaNamedQuery.addHint(0); @@ -301,12 +301,12 @@ public class JavaNamedQueryTests extends ContextModelTestCase public void testHintsSize() throws Exception { createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); NamedQuery namedQuery = entity.namedQueries().next(); assertEquals(0, namedQuery.hintsSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java index 22cfeb0917..1238b53d80 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java @@ -225,7 +225,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -235,7 +235,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -247,7 +247,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -257,7 +257,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertNull(persistentAttribute.getSpecifiedMapping()); assertTrue(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNull(attributeResource.getSupportingAnnotation(JoinTableAnnotation.ANNOTATION_NAME)); @@ -268,7 +268,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -278,7 +278,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof VersionMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); @@ -290,7 +290,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -300,7 +300,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof IdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -312,7 +312,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -322,7 +322,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -334,7 +334,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -344,7 +344,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -356,7 +356,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -366,7 +366,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof TransientMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); @@ -378,7 +378,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -388,7 +388,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); @@ -400,7 +400,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -410,7 +410,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); @@ -422,7 +422,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.setOrderBy("asdf"); oneToManyMapping.getJoinTable().setSpecifiedName("FOO"); @@ -432,7 +432,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); @@ -445,10 +445,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -470,10 +470,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -495,10 +495,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -525,10 +525,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -555,10 +555,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -580,10 +580,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getMappingAnnotation(); @@ -608,7 +608,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator<String> attributeNames = oneToManyMapping.candidateMappedByAttributeNames(); @@ -636,7 +636,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit, default still set, handled by validation @@ -650,7 +650,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("foo"); assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity()); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType(); @@ -666,7 +666,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); assertNull(oneToManyMapping.getDefaultTargetEntity()); @@ -678,7 +678,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); assertNull(oneToManyMapping.getDefaultTargetEntity()); @@ -689,7 +689,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity()); @@ -705,7 +705,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithValidOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit @@ -714,7 +714,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase //add targetEntity to the persistence unit, now target entity should resolve createTestTargetEntityAddress(); addXmlClassRef(PACKAGE_NAME + ".Address"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping(); @@ -738,10 +738,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(oneToManyMapping.getMapKey()); @@ -773,10 +773,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(oneToManyMapping.getMapKey()); @@ -798,10 +798,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(oneToManyMapping.getOrderBy()); @@ -824,10 +824,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(oneToManyMapping.getOrderBy()); @@ -849,10 +849,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertTrue(oneToManyMapping.isNoOrdering()); @@ -876,10 +876,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(oneToManyMapping.isPkOrdering()); @@ -903,10 +903,10 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase createTestEntityWithOneToManyMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertFalse(oneToManyMapping.isCustomOrdering()); @@ -932,7 +932,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".Department"); addXmlClassRef(PACKAGE_NAME + ".Employee"); - JavaPersistentType departmentPersistentType = javaPersistentType(); + JavaPersistentType departmentPersistentType = getJavaPersistentType(); OneToManyMapping employeesMapping = (OneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getSpecifiedMapping(); assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java index bca0afa544..454f010925 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java @@ -185,7 +185,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -194,7 +194,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -205,7 +205,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -214,7 +214,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertNull(persistentAttribute.getSpecifiedMapping()); assertTrue(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNull(attributeResource.getSupportingAnnotation(JoinColumnAnnotation.ANNOTATION_NAME)); @@ -224,7 +224,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -233,7 +233,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof VersionMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); @@ -244,7 +244,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -253,7 +253,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof IdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -264,7 +264,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -273,7 +273,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -284,7 +284,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -293,7 +293,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -304,7 +304,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -313,7 +313,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof TransientMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); @@ -324,7 +324,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -333,7 +333,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); @@ -344,7 +344,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -353,7 +353,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); @@ -364,7 +364,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -373,7 +373,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); @@ -385,10 +385,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -410,10 +410,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -435,10 +435,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -460,10 +460,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -485,10 +485,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -515,10 +515,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -545,10 +545,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -575,10 +575,10 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToOneAnnotation oneToOne = (OneToOneAnnotation) attributeResource.getMappingAnnotation(); @@ -605,14 +605,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); ListIterator<JavaJoinColumn> specifiedJoinColumns = oneToOneMapping.specifiedJoinColumns(); assertFalse(specifiedJoinColumns.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -671,7 +671,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertEquals(0, oneToOneMapping.specifiedJoinColumnsSize()); @@ -687,7 +687,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertEquals(1, oneToOneMapping.joinColumnsSize()); @@ -711,14 +711,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAR"); oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME); @@ -732,14 +732,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); oneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME); @@ -752,14 +752,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); oneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME))); @@ -800,14 +800,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); oneToOneMapping.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); + JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ListIterator<NestableAnnotation> javaJoinColumns = attributeResource.supportingAnnotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME); assertEquals(3, CollectionTools.size(javaJoinColumns)); @@ -841,9 +841,9 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); + JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); ((JoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -889,7 +889,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertTrue(oneToOneMapping.getDefaultJoinColumn().isVirtual()); @@ -907,7 +907,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator<String> attributeNames = oneToOneMapping.candidateMappedByAttributeNames(); @@ -935,7 +935,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit, default still set, handled by validation @@ -949,7 +949,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase oneToOneMapping.setSpecifiedTargetEntity("foo"); assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity()); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType(); @@ -965,7 +965,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertNull(oneToOneMapping.getDefaultTargetEntity()); @@ -977,7 +977,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".Address"); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertNull(oneToOneMapping.getDefaultTargetEntity()); @@ -988,7 +988,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestTargetEntityAddress(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity()); @@ -1004,7 +1004,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithValidOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); //targetEntity not in the persistence unit @@ -1013,7 +1013,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase //add targetEntity to the persistence unit, now target entity should resolve createTestTargetEntityAddress(); addXmlClassRef(PACKAGE_NAME + ".Address"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef addressClassRef = classRefs.next(); TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping(); @@ -1036,14 +1036,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = oneToOneMapping.primaryKeyJoinColumns(); assertFalse(primaryKeyJoinColumns.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); //add an annotation to the resource model and verify the context model is updated @@ -1098,7 +1098,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); assertEquals(0, oneToOneMapping.primaryKeyJoinColumnsSize()); @@ -1114,14 +1114,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); @@ -1135,14 +1135,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); oneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); Iterator<NestableAnnotation> joinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); @@ -1156,14 +1156,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); oneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertEquals(3, CollectionTools.size(attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME))); @@ -1204,14 +1204,14 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); oneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); oneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); oneToOneMapping.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); + JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ListIterator<NestableAnnotation> javaJoinColumns = attributeResource.supportingAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME); assertEquals(3, CollectionTools.size(javaJoinColumns)); @@ -1245,9 +1245,9 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase createTestEntityWithOneToOneMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JavaResourcePersistentAttribute attributeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); + JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ((PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); ((PrimaryKeyJoinColumnAnnotation) attributeResource.addSupportingAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java index 5f6c6cfa27..507313e6ef 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentAttributeTests.java @@ -73,7 +73,7 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertEquals("id", persistentAttribute.getName()); } @@ -82,7 +82,7 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertTrue(persistentAttribute.getMapping() instanceof JavaIdMapping); persistentAttribute.setSpecifiedMappingKey(null); @@ -93,7 +93,7 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertTrue(persistentAttribute.getSpecifiedMapping() instanceof JavaIdMapping); persistentAttribute.setSpecifiedMappingKey(null); @@ -104,7 +104,7 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertNull(persistentAttribute.getSpecifiedMapping()); assertNotNull(persistentAttribute.getMapping()); @@ -114,7 +114,7 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey()); @@ -126,7 +126,7 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey()); assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey()); @@ -136,12 +136,12 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertNull(persistentAttribute.getSpecifiedMapping()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(attributeResource.getMappingAnnotation()); assertTrue(attributeResource.getMappingAnnotation() instanceof EmbeddedAnnotation); @@ -154,12 +154,12 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNotNull(attributeResource.getMappingAnnotation()); assertTrue(attributeResource.getMappingAnnotation() instanceof EmbeddedAnnotation); @@ -172,12 +172,12 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation()); assertNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -189,10 +189,10 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.setMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME); @@ -203,10 +203,10 @@ public class JavaPersistentAttributeTests extends ContextModelTestCase createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); assertNull(persistentAttribute.getSpecifiedMapping()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); attributeResource.setMappingAnnotation(BasicAnnotation.ANNOTATION_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java index b498003857..01c0543567 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPersistentTypeTests.java @@ -39,8 +39,8 @@ public class JavaPersistentTypeTests extends ContextModelTestCase super.setUp(); XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); - persistenceResource().save(null); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getPersistenceResource().save(null); } private ICompilationUnit createTestEntity() throws Exception { @@ -215,35 +215,35 @@ public class JavaPersistentTypeTests extends ContextModelTestCase createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(FULLY_QUALIFIED_TYPE_NAME, javaPersistentType().getName()); + assertEquals(FULLY_QUALIFIED_TYPE_NAME, getJavaPersistentType().getName()); } public void testGetAccessNothingAnnotated() throws Exception { createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(AccessType.FIELD, javaPersistentType().getAccess()); + assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess()); } public void testAccessField() throws Exception { createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(AccessType.FIELD, javaPersistentType().getAccess()); + assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess()); } public void testAccessProperty() throws Exception { createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(AccessType.PROPERTY, javaPersistentType().getAccess()); + assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess()); } public void testAccessFieldAndMethodAnnotated() throws Exception { createTestEntityAnnotatedFieldAndMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(AccessType.FIELD, javaPersistentType().getAccess()); + assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess()); } public void testAccessInheritance() throws Exception { @@ -253,7 +253,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef classRef = classRefs.next(); @@ -270,7 +270,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef classRef = classRefs.next(); @@ -287,7 +287,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef classRef = classRefs.next(); @@ -304,7 +304,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef classRef = classRefs.next(); JavaPersistentType javaPersistentType = classRef.getJavaPersistentType(); @@ -321,9 +321,9 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); classRefs.next(); ClassRef classRef = classRefs.next(); JavaPersistentType javaPersistentType = classRef.getJavaPersistentType(); @@ -334,7 +334,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase } public void testAccessXmlNoAccessNoAnnotations() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntity(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); @@ -342,7 +342,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase } public void testAccessXmlEntityAccessNoAnnotations() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntity(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); @@ -354,20 +354,20 @@ public class JavaPersistentTypeTests extends ContextModelTestCase } public void testAccessXmlPersistenceUnitDefaultsAccessNoAnnotations() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntity(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); assertEquals(AccessType.FIELD, javaPersistentType.getAccess()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess()); } public void testAccessXmlEntityPropertyAccessAndFieldAnnotations() throws Exception { //xml access set to property, field annotations, JavaPersistentType access is property - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntityAnnotatedField(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); @@ -377,7 +377,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase public void testAccessXmlEntityFieldAccessAndPropertyAnnotations() throws Exception { //xml access set to field, property annotations, JavaPersistentType access is field - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntityAnnotatedMethod(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); @@ -386,24 +386,24 @@ public class JavaPersistentTypeTests extends ContextModelTestCase } public void testAccessXmlPersistenceUnitDefaultsAccessFieldAnnotations() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntityAnnotatedField(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); assertEquals(AccessType.FIELD, javaPersistentType.getAccess()); } //inheritance wins over entity-mappings specified access public void testAccessXmlEntityMappingsAccessWithInheritance() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childEntityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childEntityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); createTestEntityAnnotatedMethod(); createTestSubType(); JavaPersistentType childJavaPersistentType = childEntityPersistentType.getJavaPersistentType(); - entityMappings().setSpecifiedAccess(AccessType.FIELD); + getEntityMappings().setSpecifiedAccess(AccessType.FIELD); assertEquals(AccessType.PROPERTY, entityPersistentType.getJavaPersistentType().getAccess()); assertEquals(AccessType.PROPERTY, childJavaPersistentType.getAccess()); } @@ -411,12 +411,12 @@ public class JavaPersistentTypeTests extends ContextModelTestCase public void testAccessXmlMetadataCompleteFieldAnnotations() throws Exception { //xml access set to property, so even though there are field annotations, JavaPersistentType //access should be property - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntityAnnotatedField(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess()); } @@ -424,11 +424,11 @@ public class JavaPersistentTypeTests extends ContextModelTestCase public void testAccessNoXmlAccessXmlMetdataCompletePropertyAnnotations() throws Exception { //xml access not set, metadata complete set. JavaPersistentType access //is field?? - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); createTestEntityAnnotatedMethod(); JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType(); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertEquals(AccessType.FIELD, javaPersistentType.getAccess()); } @@ -439,7 +439,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); ClassRef classRef = classRefs.next(); JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType(); @@ -458,7 +458,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase //as the parentPersistentType because of impliedClassRefs and changes for bug 190317 addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); JavaPersistentType javaPersistentType = classRefs.next().getJavaPersistentType(); assertNotNull(javaPersistentType.getParentPersistentType()); @@ -473,7 +473,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); ClassRef classRef = classRefs.next(); JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType(); @@ -492,7 +492,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2"); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType(); JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType(); @@ -510,7 +510,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<ClassRef> classRefs = persistenceUnit().specifiedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs(); JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType(); JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType(); @@ -524,113 +524,113 @@ public class JavaPersistentTypeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMapping().getKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey()); } public void testGetMappingNull() throws Exception { createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMapping().getKey()); + assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey()); } public void testMappingKey() throws Exception { createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testMappingKeyNull() throws Exception { createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testSetMappingKey() throws Exception { createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); - javaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); + getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNotNull(typeResource.getMappingAnnotation()); assertTrue(typeResource.getMappingAnnotation() instanceof EntityAnnotation); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testSetMappingKey2() throws Exception { createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); - javaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); + getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNotNull(typeResource.getMappingAnnotation()); assertTrue(typeResource.getMappingAnnotation() instanceof EmbeddableAnnotation); - assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testSetMappingKeyNull() throws Exception { createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); - javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); + getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getMappingAnnotation()); assertNull(typeResource.getMappingAnnotation(EntityAnnotation.ANNOTATION_NAME)); - assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testGetMappingKeyMappingChangeInResourceModel() throws Exception { createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.setMappingAnnotation(EmbeddableAnnotation.ANNOTATION_NAME); - assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception { createTestType(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); typeResource.setMappingAnnotation(EntityAnnotation.ANNOTATION_NAME); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType().getMappingKey()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey()); } public void testIsMapped() throws Exception { createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertTrue(javaPersistentType().isMapped()); + assertTrue(getJavaPersistentType().isMapped()); - javaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); - assertFalse(javaPersistentType().isMapped()); + getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); + assertFalse(getJavaPersistentType().isMapped()); } public void testAttributes() throws Exception { createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaPersistentAttribute> attributes = javaPersistentType().attributes(); + ListIterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes(); assertEquals("id", attributes.next().getName()); assertFalse(attributes.hasNext()); @@ -640,7 +640,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase createTestEntityAnnotatedFieldAndMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaPersistentAttribute> attributes = javaPersistentType().attributes(); + ListIterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes(); assertEquals("id", attributes.next().getName()); assertEquals("name", attributes.next().getName()); @@ -651,43 +651,43 @@ public class JavaPersistentTypeTests extends ContextModelTestCase createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(1, javaPersistentType().attributesSize()); + assertEquals(1, getJavaPersistentType().attributesSize()); } public void testAttributesSize2() throws Exception { createTestEntityAnnotatedFieldAndMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(2, javaPersistentType().attributesSize()); + assertEquals(2, getJavaPersistentType().attributesSize()); } public void testAttributeNamed() throws Exception { createTestEntityAnnotatedMethod(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute attribute = javaPersistentType().getAttributeNamed("id"); + PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("id"); assertEquals("id", attribute.getName()); - assertNull(javaPersistentType().getAttributeNamed("name")); - assertNull(javaPersistentType().getAttributeNamed("foo")); + assertNull(getJavaPersistentType().getAttributeNamed("name")); + assertNull(getJavaPersistentType().getAttributeNamed("foo")); } public void testAttributeNamed2() throws Exception { createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute attribute = javaPersistentType().getAttributeNamed("name"); + PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("name"); assertEquals("name", attribute.getName()); - assertNull(javaPersistentType().getAttributeNamed("foo")); + assertNull(getJavaPersistentType().getAttributeNamed("foo")); } public void testRenameAttribute() throws Exception { ICompilationUnit testType = createTestEntityAnnotatedField(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaPersistentAttribute> attributes = javaPersistentType().attributes(); + ListIterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes(); JavaPersistentAttribute idAttribute = attributes.next(); JavaPersistentAttribute nameAttribute = attributes.next(); @@ -698,7 +698,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase IField idField = testType.findPrimaryType().getField("id"); idField.rename("id2", false, null); - attributes = javaPersistentType().attributes(); + attributes = getJavaPersistentType().attributes(); JavaPersistentAttribute nameAttribute2 = attributes.next(); JavaPersistentAttribute id2Attribute = attributes.next(); @@ -716,7 +716,7 @@ public class JavaPersistentTypeTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".Entity1"); addXmlClassRef(PACKAGE_NAME + ".Entity2"); - JavaPersistentType javaPersistentType = javaPersistentType(); + JavaPersistentType javaPersistentType = getJavaPersistentType(); assertEquals("test.Entity1", javaPersistentType.getName()); assertNotNull(javaPersistentType.getParentPersistentType()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java index 26011664a0..51d129c09d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java @@ -71,15 +71,15 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); pkJoinColumnResource.setName("FOO"); - specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals("FOO", specifiedPkJoinColumn.getName()); } @@ -87,7 +87,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn pkJoinColumn = javaEntity().getDefaultPrimaryKeyJoinColumn(); + PrimaryKeyJoinColumn pkJoinColumn = getJavaEntity().getDefaultPrimaryKeyJoinColumn(); assertEquals("id", pkJoinColumn.getDefaultName()); } @@ -95,13 +95,13 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn()); + assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn()); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals("id", specifiedPkJoinColumn.getDefaultName()); //remove @Id annotation - PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id"); + PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id"); idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); assertNull(specifiedPkJoinColumn.getDefaultName()); @@ -111,7 +111,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getName()); } @@ -119,12 +119,12 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); specifiedPkJoinColumn.setSpecifiedName("foo"); assertEquals("foo", specifiedPkJoinColumn.getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); assertEquals("foo", pkJoinColumn.getName()); @@ -139,10 +139,10 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertNull(specifiedPkJoinColumn.getColumnDefinition()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); column.setColumnDefinition(COLUMN_DEFINITION); @@ -154,17 +154,17 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase typeResource.removeSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); - assertEquals(0, javaEntity().specifiedPrimaryKeyJoinColumnsSize()); + assertEquals(0, getJavaEntity().specifiedPrimaryKeyJoinColumnsSize()); } public void testSetColumnDefinition() throws Exception { createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); specifiedPkJoinColumn.setColumnDefinition("foo"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); assertEquals("foo", column.getColumnDefinition()); @@ -178,14 +178,14 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); pkJoinColumnResource.setReferencedColumnName("FOO"); - specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals("FOO", specifiedPkJoinColumn.getSpecifiedReferencedColumnName()); } @@ -193,7 +193,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn pkJoinColumn = javaEntity().getDefaultPrimaryKeyJoinColumn(); + PrimaryKeyJoinColumn pkJoinColumn = getJavaEntity().getDefaultPrimaryKeyJoinColumn(); assertEquals("id", pkJoinColumn.getDefaultReferencedColumnName()); } @@ -201,14 +201,14 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn()); + assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn()); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals("id", specifiedPkJoinColumn.getDefaultReferencedColumnName()); //remove @Id annotation - PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id"); + PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id"); idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); assertNull(specifiedPkJoinColumn.getDefaultReferencedColumnName()); @@ -218,12 +218,12 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); pkJoinColumnResource.setReferencedColumnName("FOO"); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertEquals("FOO", specifiedPkJoinColumn.getReferencedColumnName()); } @@ -231,12 +231,12 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); specifiedPkJoinColumn.setSpecifiedReferencedColumnName("foo"); assertEquals("foo", specifiedPkJoinColumn.getSpecifiedReferencedColumnName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) typeResource.getSupportingAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); assertEquals("foo", pkJoinColumn.getReferencedColumnName()); @@ -252,19 +252,19 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertFalse(specifiedPkJoinColumn.isVirtual()); - assertNull(javaEntity().getDefaultPrimaryKeyJoinColumn()); - javaEntity().removeSpecifiedPrimaryKeyJoinColumn(0); - assertTrue(javaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual()); + assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn()); + getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(0); + assertTrue(getJavaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual()); } public void testIsReferencedColumnResolved() throws Exception { createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertFalse(specifiedPkJoinColumn.isReferencedColumnResolved()); } @@ -272,7 +272,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertNull(specifiedPkJoinColumn.getDbColumn()); } @@ -280,7 +280,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertNull(specifiedPkJoinColumn.getReferencedDbColumn()); } @@ -288,7 +288,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase createTestEntityWithPrimaryKeyJoinColumn(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); + PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().specifiedPrimaryKeyJoinColumns().next(); assertNull(specifiedPkJoinColumn.getDbTable()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java index 5b748e0889..24ff7a1737 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaQueryHintTests.java @@ -48,10 +48,10 @@ public class JavaQueryHintTests extends ContextModelTestCase createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); QueryHint queryHint = entity.namedQueries().next().hints().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); QueryHintAnnotation javaQueryHint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next(); assertNull(javaQueryHint.getName()); @@ -72,10 +72,10 @@ public class JavaQueryHintTests extends ContextModelTestCase createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); QueryHint queryHint = entity.namedQueries().next().hints().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); QueryHintAnnotation javaQueryhint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next(); assertNull(javaQueryhint.getName()); @@ -96,10 +96,10 @@ public class JavaQueryHintTests extends ContextModelTestCase createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); QueryHint queryHint = entity.namedQueries().next().hints().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); QueryHintAnnotation javaQueryhint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next(); assertNull(javaQueryhint.getValue()); @@ -120,10 +120,10 @@ public class JavaQueryHintTests extends ContextModelTestCase createTestEntityWithNamedQuery(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Entity entity = javaEntity(); + Entity entity = getJavaEntity(); QueryHint queryHint = entity.namedQueries().next().hints().next(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); QueryHintAnnotation javaQueryhint = ((NamedQueryAnnotation) typeResource.getSupportingAnnotation(NamedQueryAnnotation.ANNOTATION_NAME)).hints().next(); assertNull(javaQueryhint.getValue()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java index 2381bde08a..45de2f10d2 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSecondaryTableTests.java @@ -78,7 +78,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().secondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().secondaryTables().next(); assertEquals(TABLE_NAME, secondaryTable.getSpecifiedName()); } @@ -86,7 +86,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().secondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().secondaryTables().next(); assertNull(secondaryTable.getDefaultName()); } @@ -94,7 +94,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().secondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().secondaryTables().next(); assertEquals(TABLE_NAME, secondaryTable.getName()); } @@ -102,12 +102,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().secondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().secondaryTables().next(); secondaryTable.setSpecifiedName("foo"); - assertEquals("foo", javaEntity().secondaryTables().next().getSpecifiedName()); + assertEquals("foo", getJavaEntity().secondaryTables().next().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); assertEquals("foo", table.getName()); @@ -117,12 +117,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().secondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().secondaryTables().next(); secondaryTable.setSpecifiedName(null); - assertEquals(0, javaEntity().secondaryTablesSize()); + assertEquals(0, getJavaEntity().secondaryTablesSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); assertNull(typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE)); } @@ -130,23 +130,23 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); table.setName("foo"); - assertEquals("foo", javaEntity().secondaryTables().next().getSpecifiedName()); + assertEquals("foo", getJavaEntity().secondaryTables().next().getSpecifiedName()); } public void testUpdateFromSpecifiedCatalogChangeInResourceModel() throws Exception { createTestEntityWithSecondaryTables(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); ListIterator<NestableAnnotation> secondaryTableResources = typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("foo"); ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("bar"); - ListIterator<SecondaryTable> secondaryTsbles = javaEntity().secondaryTables(); + ListIterator<SecondaryTable> secondaryTsbles = getJavaEntity().secondaryTables(); assertEquals("foo", secondaryTsbles.next().getSpecifiedCatalog()); assertEquals("bar", secondaryTsbles.next().getSpecifiedCatalog()); } @@ -155,12 +155,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTables(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); ListIterator<NestableAnnotation> secondaryTableResources = typeResource.supportingAnnotations(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES); ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("foo"); ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("bar"); - ListIterator<SecondaryTable> secondaryTsbles = javaEntity().secondaryTables(); + ListIterator<SecondaryTable> secondaryTsbles = getJavaEntity().secondaryTables(); assertEquals("foo", secondaryTsbles.next().getSpecifiedSchema()); assertEquals("bar", secondaryTsbles.next().getSpecifiedSchema()); } @@ -169,34 +169,34 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation table = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); table.setCatalog("myCatalog"); - assertEquals("myCatalog", javaEntity().secondaryTables().next().getSpecifiedCatalog()); - assertEquals("myCatalog", javaEntity().secondaryTables().next().getCatalog()); + assertEquals("myCatalog", getJavaEntity().secondaryTables().next().getSpecifiedCatalog()); + assertEquals("myCatalog", getJavaEntity().secondaryTables().next().getCatalog()); } public void testGetDefaultCatalog() throws Exception { createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().secondaryTables().next().getDefaultCatalog()); + assertNull(getJavaEntity().secondaryTables().next().getDefaultCatalog()); - javaEntity().secondaryTables().next().setSpecifiedCatalog("myCatalog"); + getJavaEntity().secondaryTables().next().setSpecifiedCatalog("myCatalog"); - assertNull(javaEntity().secondaryTables().next().getDefaultCatalog()); + assertNull(getJavaEntity().secondaryTables().next().getDefaultCatalog()); } public void testSetSpecifiedCatalog() throws Exception { createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable table = javaEntity().secondaryTables().next(); + SecondaryTable table = getJavaEntity().secondaryTables().next(); table.setSpecifiedCatalog("myCatalog"); table.setSpecifiedName(null); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); assertEquals("myCatalog", tableResource.getCatalog()); @@ -209,34 +209,34 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); tableResource.setSchema("mySchema"); - assertEquals("mySchema", javaEntity().secondaryTables().next().getSpecifiedSchema()); - assertEquals("mySchema", javaEntity().secondaryTables().next().getSchema()); + assertEquals("mySchema", getJavaEntity().secondaryTables().next().getSpecifiedSchema()); + assertEquals("mySchema", getJavaEntity().secondaryTables().next().getSchema()); } public void testGetDefaultSchema() throws Exception { createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().secondaryTables().next().getDefaultSchema()); + assertNull(getJavaEntity().secondaryTables().next().getDefaultSchema()); - javaEntity().secondaryTables().next().setSpecifiedSchema("mySchema"); + getJavaEntity().secondaryTables().next().setSpecifiedSchema("mySchema"); - assertNull(javaEntity().secondaryTables().next().getDefaultSchema()); + assertNull(getJavaEntity().secondaryTables().next().getDefaultSchema()); } public void testSetSpecifiedSchema() throws Exception { createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable table = javaEntity().secondaryTables().next(); + SecondaryTable table = getJavaEntity().secondaryTables().next(); table.setSpecifiedSchema("mySchema"); table.setSpecifiedName(null); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); assertEquals("mySchema", tableResource.getSchema()); @@ -249,12 +249,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.specifiedPrimaryKeyJoinColumns(); assertFalse(specifiedPkJoinColumns.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); //add an annotation to the resource model and verify the context model is updated @@ -293,7 +293,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); assertEquals(0, secondaryTable.specifiedPrimaryKeyJoinColumnsSize()); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); @@ -307,7 +307,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); //just the default pkJoinColumn, so 1 assertEquals(1, secondaryTable.primaryKeyJoinColumnsSize()); @@ -323,7 +323,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); assertNotNull(secondaryTable.getDefaultPrimaryKeyJoinColumn()); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); @@ -337,14 +337,14 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn(); assertNotNull(defaultPkJoinColumn); assertEquals("id", defaultPkJoinColumn.getDefaultName()); assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName()); - IdMapping idMapping = (IdMapping) javaEntity().getPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaEntity().getPersistentType().getAttributeNamed("id").getMapping(); idMapping.getColumn().setSpecifiedName("FOO"); assertEquals("FOO", defaultPkJoinColumn.getDefaultName()); assertEquals("FOO", defaultPkJoinColumn.getDefaultReferencedColumnName()); @@ -358,7 +358,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ"); @@ -368,7 +368,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase assertEquals("BAR", specifiedPkJoinColumns.next().getName()); assertEquals("FOO", specifiedPkJoinColumns.next().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.pkJoinColumns(); @@ -382,7 +382,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); @@ -393,7 +393,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase assertEquals("BAR", specifiedPkJoinColumns.next().getName()); assertEquals("BAZ", specifiedPkJoinColumns.next().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.pkJoinColumns(); @@ -406,13 +406,13 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); assertEquals(3, tableResource.pkJoinColumnsSize()); @@ -453,7 +453,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); @@ -463,7 +463,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase assertEquals("BAR", specifiedPkJoinColumns.next().getName()); assertEquals("BAZ", specifiedPkJoinColumns.next().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) typeResource.getSupportingAnnotation(JPA.SECONDARY_TABLE); Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.pkJoinColumns(); @@ -484,13 +484,13 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn(); assertEquals("id", defaultPkJoinColumn.getDefaultName()); //remove @Id annotation - PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id"); + PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id"); idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); assertNull(defaultPkJoinColumn.getDefaultName()); @@ -499,12 +499,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn(); assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName()); //remove @Id annotation - PersistentAttribute idAttribute = javaPersistentType().getAttributeNamed("id"); + PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id"); idAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); assertNull(defaultPkJoinColumn.getDefaultReferencedColumnName()); @@ -513,7 +513,7 @@ public class JavaSecondaryTableTests extends ContextModelTestCase public void testPrimaryKeyJoinColumnIsVirtual() throws Exception { createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); assertTrue(secondaryTable.getDefaultPrimaryKeyJoinColumn().isVirtual()); @@ -529,12 +529,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar"); @@ -550,11 +550,11 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); assertEquals(0, secondaryTable.uniqueConstraintsSize()); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); secondaryTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar"); @@ -566,12 +566,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR"); secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.uniqueConstraints(); @@ -585,12 +585,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR"); secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.uniqueConstraints(); @@ -604,12 +604,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR"); secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); assertEquals(3, secondaryTableAnnotation.uniqueConstraintsSize()); @@ -648,12 +648,12 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR"); secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); assertEquals(3, secondaryTableAnnotation.uniqueConstraintsSize()); @@ -687,8 +687,8 @@ public class JavaSecondaryTableTests extends ContextModelTestCase createTestEntityWithSecondaryTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - SecondaryTable secondaryTable = javaEntity().specifiedSecondaryTables().next(); - JavaResourcePersistentType resourcePersistentType = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + SecondaryTable secondaryTable = getJavaEntity().specifiedSecondaryTables().next(); + JavaResourcePersistentType resourcePersistentType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourcePersistentType.getSupportingAnnotation(JPA.SECONDARY_TABLE); secondaryTableAnnotation.addUniqueConstraint(0).addColumnName("FOO"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java index 294b0801c1..0b46e2ffae 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaSequenceGeneratorTests.java @@ -54,11 +54,11 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getSequenceGenerator().getName()); //change resource model sequenceGenerator name, verify the context model is updated - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -71,14 +71,14 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getSequenceGenerator().getName()); idMapping.getSequenceGenerator().setName("foo"); assertEquals("foo", idMapping.getSequenceGenerator().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -89,14 +89,14 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getSequenceGenerator().getName()); idMapping.getSequenceGenerator().setName(null); assertNull(idMapping.getSequenceGenerator()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -107,10 +107,10 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getSequenceGenerator().getInitialValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -124,7 +124,7 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getSequenceGenerator().getDefaultInitialValue()); @@ -138,10 +138,10 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(20)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -156,11 +156,11 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getSequenceGenerator().getAllocationSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -174,7 +174,7 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getSequenceGenerator().getDefaultAllocationSize()); @@ -188,10 +188,10 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(25)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -208,10 +208,10 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getSequenceGenerator().getSequenceName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); @@ -225,7 +225,7 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getSequenceGenerator().getDefaultSequenceName()); @@ -239,10 +239,10 @@ public class JavaSequenceGeneratorTests extends ContextModelTestCase createTestEntityWithSequenceGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getSequenceGenerator().setSpecifiedSequenceName("mySequenceName"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.SEQUENCE_GENERATOR); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java index a4633b5e47..fa634e67b1 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableGeneratorTests.java @@ -63,11 +63,11 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(TABLE_GENERATOR_NAME, idMapping.getTableGenerator().getName()); //change resource model tableGenerator name, verify the context model is updated - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -80,14 +80,14 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(TABLE_GENERATOR_NAME, idMapping.getTableGenerator().getName()); idMapping.getTableGenerator().setName("foo"); assertEquals("foo", idMapping.getTableGenerator().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -98,14 +98,14 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(TABLE_GENERATOR_NAME, idMapping.getTableGenerator().getName()); idMapping.getTableGenerator().setName(null); assertNull(idMapping.getTableGenerator()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -116,10 +116,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getCatalog()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -133,7 +133,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getDefaultCatalog()); @@ -147,10 +147,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedCatalog("myCatalog"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -165,10 +165,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getSchema()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -182,7 +182,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getDefaultSchema()); @@ -195,39 +195,39 @@ public class JavaTableGeneratorTests extends ContextModelTestCase public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception { XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); createTestEntityWithTableGenerator(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); IdMapping idMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", idMapping.getTableGenerator().getDefaultSchema()); - entityMappings().setSpecifiedSchema("BAR"); + getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", idMapping.getTableGenerator().getDefaultSchema()); ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA"); assertEquals("BAR", idMapping.getTableGenerator().getDefaultSchema()); - entityMappings().removeOrmPersistentType(0); + getEntityMappings().removeOrmPersistentType(0); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file - assertEquals("FOO", ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator().getDefaultSchema()); + assertEquals("FOO", ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator().getDefaultSchema()); } public void testSetSpecifiedSchema() throws Exception { createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedSchema("mySchema"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -242,10 +242,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getPkColumnName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -259,7 +259,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getDefaultPkColumnName()); @@ -273,10 +273,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedPkColumnName("myPkColumnName"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -291,10 +291,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getValueColumnName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -308,7 +308,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getDefaultValueColumnName()); @@ -322,10 +322,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedValueColumnName("myValueColumnName"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -340,10 +340,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getPkColumnValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -357,7 +357,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertNull(idMapping.getTableGenerator().getDefaultPkColumnValue()); @@ -371,10 +371,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -389,10 +389,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getTableGenerator().getInitialValue()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -406,7 +406,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getTableGenerator().getDefaultInitialValue()); @@ -420,10 +420,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(20)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -438,11 +438,11 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getTableGenerator().getAllocationSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -456,7 +456,7 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getTableGenerator().getDefaultAllocationSize()); @@ -470,10 +470,10 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - IdMapping idMapping = (IdMapping) javaPersistentType().getAttributeNamed("id").getMapping(); + IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping(); idMapping.getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(25)); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -489,12 +489,12 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); ListIterator<JavaUniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); @@ -511,11 +511,11 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); assertEquals(0, tableGenerator.uniqueConstraintsSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); @@ -528,12 +528,12 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR"); tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.uniqueConstraints(); @@ -548,12 +548,12 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR"); tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.uniqueConstraints(); @@ -568,12 +568,12 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR"); tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -613,12 +613,12 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR"); tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); @@ -653,8 +653,8 @@ public class JavaTableGeneratorTests extends ContextModelTestCase createTestEntityWithTableGenerator(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - TableGenerator tableGenerator = ((IdMapping) javaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getTableGenerator(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) attributeResource.getSupportingAnnotation(JPA.TABLE_GENERATOR); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java index 6efb7411cc..66617e3d84 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java @@ -89,32 +89,32 @@ public class JavaTableTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getTable().getSpecifiedName()); + assertNull(getJavaEntity().getTable().getSpecifiedName()); } public void testGetSpecifiedName() throws Exception { createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TABLE_NAME, javaEntity().getTable().getSpecifiedName()); + assertEquals(TABLE_NAME, getJavaEntity().getTable().getSpecifiedName()); } public void testGetDefaultNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getTable().getDefaultName()); + assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName()); } public void testGetDefaultName() throws Exception { createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getTable().getDefaultName()); + assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName()); //test that setting the java entity name will change the table default name - javaEntity().setSpecifiedName("foo"); - assertEquals("foo", javaEntity().getTable().getDefaultName()); + getJavaEntity().setSpecifiedName("foo"); + assertEquals("foo", getJavaEntity().getTable().getDefaultName()); } public void testGetDefaultNameSingleTableInheritance() throws Exception { @@ -124,75 +124,75 @@ public class JavaTableTests extends ContextModelTestCase addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild"); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNotSame(javaEntity(), javaEntity().getRootEntity()); - assertEquals(TYPE_NAME, javaEntity().getTable().getDefaultName()); - assertEquals(TYPE_NAME, javaEntity().getRootEntity().getTable().getDefaultName()); + assertNotSame(getJavaEntity(), getJavaEntity().getRootEntity()); + assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName()); + assertEquals(TYPE_NAME, getJavaEntity().getRootEntity().getTable().getDefaultName()); //test that setting the root java entity name will change the table default name of the child - javaEntity().getRootEntity().setSpecifiedName("foo"); - assertEquals("foo", javaEntity().getTable().getDefaultName()); + getJavaEntity().getRootEntity().setSpecifiedName("foo"); + assertEquals("foo", getJavaEntity().getTable().getDefaultName()); } public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception { XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); createTestEntity(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); JavaEntity javaEntity = ormEntity.getJavaEntity(); assertNull(javaEntity.getTable().getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", javaEntity.getTable().getDefaultSchema()); - entityMappings().setSpecifiedSchema("BAR"); + getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", javaEntity.getTable().getDefaultSchema()); ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA"); assertEquals("BAR", javaEntity.getTable().getDefaultSchema()); - entityMappings().removeOrmPersistentType(0); + getEntityMappings().removeOrmPersistentType(0); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file - assertEquals("FOO", javaEntity().getTable().getDefaultSchema()); + assertEquals("FOO", getJavaEntity().getTable().getDefaultSchema()); - IFile file = ormResource().getFile(); + IFile file = getOrmResource().getFile(); //remove the mapping file reference from the persistence.xml. default schema //should still come from persistence-unit-defaults because of implied mapped-file-ref - xmlPersistenceUnit().getMappingFiles().remove(mappingFileRef); - assertEquals("FOO", javaEntity().getTable().getDefaultSchema()); + getXmlPersistenceUnit().getMappingFiles().remove(mappingFileRef); + assertEquals("FOO", getJavaEntity().getTable().getDefaultSchema()); file.delete(true, null); - assertNull(javaEntity().getTable().getDefaultSchema()); + assertNull(getJavaEntity().getTable().getDefaultSchema()); } public void testGetNameSpecifiedNameNull() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TYPE_NAME, javaEntity().getTable().getName()); + assertEquals(TYPE_NAME, getJavaEntity().getTable().getName()); } public void testGetName() throws Exception { createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(TABLE_NAME, javaEntity().getTable().getName()); + assertEquals(TABLE_NAME, getJavaEntity().getTable().getName()); } public void testSetSpecifiedName() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().getTable().setSpecifiedName("foo"); + getJavaEntity().getTable().setSpecifiedName("foo"); - assertEquals("foo", javaEntity().getTable().getSpecifiedName()); + assertEquals("foo", getJavaEntity().getTable().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); assertEquals("foo", table.getName()); @@ -202,11 +202,11 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - javaEntity().getTable().setSpecifiedName(null); + getJavaEntity().getTable().setSpecifiedName(null); - assertNull(javaEntity().getTable().getSpecifiedName()); + assertNull(getJavaEntity().getTable().getSpecifiedName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); assertNull(table); @@ -216,84 +216,84 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); table.setName("foo"); - assertEquals("foo", javaEntity().getTable().getSpecifiedName()); + assertEquals("foo", getJavaEntity().getTable().getSpecifiedName()); typeResource.removeSupportingAnnotation(JPA.TABLE); - assertNull(javaEntity().getTable().getSpecifiedName()); + assertNull(getJavaEntity().getTable().getSpecifiedName()); } public void testGetCatalog() throws Exception { createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); table.setCatalog("myCatalog"); - assertEquals("myCatalog", javaEntity().getTable().getSpecifiedCatalog()); - assertEquals("myCatalog", javaEntity().getTable().getCatalog()); + assertEquals("myCatalog", getJavaEntity().getTable().getSpecifiedCatalog()); + assertEquals("myCatalog", getJavaEntity().getTable().getCatalog()); } public void testGetDefaultCatalog() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getTable().getDefaultCatalog()); + assertNull(getJavaEntity().getTable().getDefaultCatalog()); - javaEntity().getTable().setSpecifiedCatalog("myCatalog"); + getJavaEntity().getTable().setSpecifiedCatalog("myCatalog"); - assertNull(javaEntity().getTable().getDefaultCatalog()); + assertNull(getJavaEntity().getTable().getDefaultCatalog()); } public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception { XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH); - xmlPersistenceUnit().getMappingFiles().add(mappingFileRef); + getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef); createTestEntity(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); JavaEntity javaEntity = ormEntity.getJavaEntity(); assertNull(javaEntity.getTable().getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); assertEquals("FOO", javaEntity.getTable().getDefaultCatalog()); - entityMappings().setSpecifiedCatalog("BAR"); + getEntityMappings().setSpecifiedCatalog("BAR"); assertEquals("BAR", javaEntity.getTable().getDefaultCatalog()); ormEntity.getTable().setSpecifiedCatalog("XML_CATALOG"); assertEquals("BAR", javaEntity.getTable().getDefaultCatalog()); - entityMappings().removeOrmPersistentType(0); + getEntityMappings().removeOrmPersistentType(0); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); //default catalog taken from persistence-unite-defaults not entity-mappings since the entity is not in an orm.xml file - assertEquals("FOO", javaEntity().getTable().getDefaultCatalog()); + assertEquals("FOO", getJavaEntity().getTable().getDefaultCatalog()); - IFile file = ormResource().getFile(); + IFile file = getOrmResource().getFile(); //remove the mapping file reference from the persistence.xml. default schema //should still come from persistence-unit-defaults because of implied mapped-file-ref - xmlPersistenceUnit().getMappingFiles().remove(mappingFileRef); - assertEquals("FOO", javaEntity().getTable().getDefaultCatalog()); + getXmlPersistenceUnit().getMappingFiles().remove(mappingFileRef); + assertEquals("FOO", getJavaEntity().getTable().getDefaultCatalog()); file.delete(true, null); - assertNull(javaEntity().getTable().getDefaultCatalog()); + assertNull(getJavaEntity().getTable().getDefaultCatalog()); } public void testSetSpecifiedCatalog() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); table.setSpecifiedCatalog("myCatalog"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableResource = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); assertEquals("myCatalog", tableResource.getCatalog()); @@ -306,33 +306,33 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation table = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); table.setSchema("mySchema"); - assertEquals("mySchema", javaEntity().getTable().getSpecifiedSchema()); - assertEquals("mySchema", javaEntity().getTable().getSchema()); + assertEquals("mySchema", getJavaEntity().getTable().getSpecifiedSchema()); + assertEquals("mySchema", getJavaEntity().getTable().getSchema()); } public void testGetDefaultSchema() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertNull(javaEntity().getTable().getDefaultSchema()); + assertNull(getJavaEntity().getTable().getDefaultSchema()); - javaEntity().getTable().setSpecifiedSchema("mySchema"); + getJavaEntity().getTable().setSpecifiedSchema("mySchema"); - assertNull(javaEntity().getTable().getDefaultSchema()); + assertNull(getJavaEntity().getTable().getDefaultSchema()); } public void testSetSpecifiedSchema() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); table.setSpecifiedSchema("mySchema"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableResource = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); assertEquals("mySchema", tableResource.getSchema()); @@ -345,15 +345,15 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - ListIterator<JavaUniqueConstraint> uniqueConstraints = javaEntity().getTable().uniqueConstraints(); + ListIterator<JavaUniqueConstraint> uniqueConstraints = getJavaEntity().getTable().uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); tableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar"); - uniqueConstraints = javaEntity().getTable().uniqueConstraints(); + uniqueConstraints = getJavaEntity().getTable().uniqueConstraints(); assertTrue(uniqueConstraints.hasNext()); assertEquals("bar", uniqueConstraints.next().columnNames().next()); assertEquals("foo", uniqueConstraints.next().columnNames().next()); @@ -364,26 +364,26 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(0, javaEntity().getTable().uniqueConstraintsSize()); + assertEquals(0, getJavaEntity().getTable().uniqueConstraintsSize()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo"); tableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar"); - assertEquals(2, javaEntity().getTable().uniqueConstraintsSize()); + assertEquals(2, getJavaEntity().getTable().uniqueConstraintsSize()); } public void testAddUniqueConstraint() throws Exception { createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); table.addUniqueConstraint(0).addColumnName(0, "FOO"); table.addUniqueConstraint(0).addColumnName(0, "BAR"); table.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.uniqueConstraints(); @@ -397,12 +397,12 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); table.addUniqueConstraint(0).addColumnName(0, "FOO"); table.addUniqueConstraint(1).addColumnName(0, "BAR"); table.addUniqueConstraint(0).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.uniqueConstraints(); @@ -416,12 +416,12 @@ public class JavaTableTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); table.addUniqueConstraint(0).addColumnName(0, "FOO"); table.addUniqueConstraint(1).addColumnName(0, "BAR"); table.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); assertEquals(3, tableAnnotation.uniqueConstraintsSize()); @@ -460,12 +460,12 @@ public class JavaTableTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); + Table table = getJavaEntity().getTable(); table.addUniqueConstraint(0).addColumnName(0, "FOO"); table.addUniqueConstraint(1).addColumnName(0, "BAR"); table.addUniqueConstraint(2).addColumnName(0, "BAZ"); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); assertEquals(3, tableAnnotation.uniqueConstraintsSize()); @@ -499,8 +499,8 @@ public class JavaTableTests extends ContextModelTestCase createTestEntityWithTable(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - Table table = javaEntity().getTable(); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + Table table = getJavaEntity().getTable(); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); TableAnnotation tableAnnotation = (TableAnnotation) typeResource.getSupportingAnnotation(JPA.TABLE); tableAnnotation.addUniqueConstraint(0).addColumnName("FOO"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java index 9ac65c6d5d..6f2ca904a6 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTransientMappingTests.java @@ -68,7 +68,7 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); @@ -76,7 +76,7 @@ public class JavaTransientMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertFalse(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -86,7 +86,7 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); @@ -94,7 +94,7 @@ public class JavaTransientMappingTests extends ContextModelTestCase assertTrue(persistentAttribute.getMapping() instanceof BasicMapping); assertTrue(persistentAttribute.getMapping().isDefault()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); } @@ -103,14 +103,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof VersionMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); @@ -120,14 +120,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -137,14 +137,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof IdMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -154,14 +154,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -171,14 +171,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); @@ -188,14 +188,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); @@ -205,14 +205,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); @@ -222,14 +222,14 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping(); assertFalse(transientMapping.isDefault()); persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); @@ -239,7 +239,7 @@ public class JavaTransientMappingTests extends ContextModelTestCase createTestEntityWithTransientMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); TransientMapping transientMapping = (TransientMapping) persistentAttribute.getSpecifiedMapping(); assertNotNull(transientMapping); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java index ea4c798558..a8b6f2cce9 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaVersionMappingTests.java @@ -91,7 +91,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -103,7 +103,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName()); assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(BasicAnnotation.ANNOTATION_NAME)); @@ -115,7 +115,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -127,7 +127,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName()); assertEquals(TemporalType.TIME, ((TemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getSupportingAnnotation(ColumnAnnotation.ANNOTATION_NAME)); @@ -138,7 +138,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -150,7 +150,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName()); assertEquals(TemporalType.TIME, ((TemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(IdAnnotation.ANNOTATION_NAME)); @@ -162,7 +162,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -173,7 +173,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedAnnotation.ANNOTATION_NAME)); @@ -185,7 +185,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -196,7 +196,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof TransientMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(TransientAnnotation.ANNOTATION_NAME)); @@ -208,7 +208,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -219,7 +219,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME)); @@ -231,7 +231,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -242,7 +242,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToOneAnnotation.ANNOTATION_NAME)); @@ -254,7 +254,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -265,7 +265,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(OneToManyAnnotation.ANNOTATION_NAME)); @@ -277,7 +277,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -288,7 +288,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToOneAnnotation.ANNOTATION_NAME)); @@ -300,7 +300,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping(); assertFalse(versionMapping.isDefault()); versionMapping.getColumn().setSpecifiedName("FOO"); @@ -311,7 +311,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); assertNull(attributeResource.getMappingAnnotation(VersionAnnotation.ANNOTATION_NAME)); assertNotNull(attributeResource.getMappingAnnotation(ManyToManyAnnotation.ANNOTATION_NAME)); @@ -324,7 +324,7 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithTemporal(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(TemporalType.TIMESTAMP, ((TemporalConverter) versionMapping.getConverter()).getTemporalType()); @@ -334,14 +334,14 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType()); versionMapping.setSpecifiedConverter(Converter.TEMPORAL_CONVERTER); ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); @@ -355,13 +355,13 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping(); assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.addSupportingAnnotation(TemporalAnnotation.ANNOTATION_NAME); temporal.setValue(org.eclipse.jpt.core.resource.java.TemporalType.DATE); @@ -379,13 +379,13 @@ public class JavaVersionMappingTests extends ContextModelTestCase createTestEntityWithVersionMapping(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); + PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping(); assertNull(versionMapping.getColumn().getSpecifiedName()); assertEquals("id", versionMapping.getColumn().getName()); - JavaResourcePersistentType typeResource = jpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); + JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ColumnAnnotation column = (ColumnAnnotation) attributeResource.addSupportingAnnotation(JPA.COLUMN); column.setName("foo"); |