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 | |
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')
74 files changed, 3490 insertions, 3490 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java index c5ba89db3e..14fa990a82 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java @@ -82,7 +82,7 @@ public abstract class ContextModelTestCase extends AnnotationTestCase return null; } - protected JpaProject jpaProject() { + protected JpaProject getJpaProject() { return getJavaProject().getJpaProject(); } @@ -103,45 +103,45 @@ public abstract class ContextModelTestCase extends AnnotationTestCase } } - protected PersistenceResource persistenceResource() { + protected PersistenceResource getPersistenceResource() { return this.persistenceResourceModelProvider.getResource(); } - protected OrmResource ormResource() { + protected OrmResource getOrmResource() { return this.ormResourceModelProvider.getResource(); } - protected XmlPersistence xmlPersistence() { - return persistenceResource().getPersistence(); + protected XmlPersistence getXmlPersistence() { + return getPersistenceResource().getPersistence(); } - protected EntityMappings entityMappings() { - MappingFile mappingFile = persistenceUnit().mappingFileRefs().next().getMappingFile(); + protected EntityMappings getEntityMappings() { + MappingFile mappingFile = getPersistenceUnit().mappingFileRefs().next().getMappingFile(); return (mappingFile == null) ? null : (EntityMappings) mappingFile.getRoot(); } - protected XmlPersistenceUnit xmlPersistenceUnit() { - return persistenceResource().getPersistence().getPersistenceUnits().get(0); + protected XmlPersistenceUnit getXmlPersistenceUnit() { + return getXmlPersistence().getPersistenceUnits().get(0); } - protected PersistenceUnit persistenceUnit() { + protected PersistenceUnit getPersistenceUnit() { return getRootContextNode().getPersistenceXml().getPersistence().persistenceUnits().next(); } - protected ClassRef classRef() { - return persistenceUnit().specifiedClassRefs().next(); + protected ClassRef getSpecifiedClassRef() { + return getPersistenceUnit().specifiedClassRefs().next(); } - protected JavaPersistentType javaPersistentType() { - return classRef().getJavaPersistentType(); + protected JavaPersistentType getJavaPersistentType() { + return getSpecifiedClassRef().getJavaPersistentType(); } - protected Entity javaEntity() { - return (Entity) javaPersistentType().getMapping(); + protected Entity getJavaEntity() { + return (Entity) getJavaPersistentType().getMapping(); } protected void addXmlClassRef(String className) { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); xmlClassRef.setJavaClass(className); @@ -149,7 +149,7 @@ public abstract class ContextModelTestCase extends AnnotationTestCase } protected void removeXmlClassRef(String className) { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); XmlJavaClassRef xmlJavaClassRefToRemove = null; for (XmlJavaClassRef xmlJavaClassRef : xmlPersistenceUnit.getClasses()) { if (xmlJavaClassRef.getJavaClass().equals(className)) { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java index d77ebadc11..2f23b6c2b4 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/JpaFileTests.java @@ -40,8 +40,8 @@ public class JpaFileTests 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 { @@ -58,12 +58,12 @@ public class JpaFileTests extends ContextModelTestCase } public void testGetRootStructureNode() throws Exception { - 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); - IFile file = ormResource().getFile(); + IFile file = getOrmResource().getFile(); JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file); - assertEquals(entityMappings(), ormXmlJpaFile.rootStructureNodes().next()); + assertEquals(getEntityMappings(), ormXmlJpaFile.rootStructureNodes().next()); ICompilationUnit cu = createTestEntity(); @@ -77,50 +77,50 @@ public class JpaFileTests extends ContextModelTestCase //persistence.xml <class> tag and mapping file <entity> tag exist for a particulary java class assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); - entityMappings().removeOrmPersistentType(ormPersistentType); + getEntityMappings().removeOrmPersistentType(ormPersistentType); - assertEquals(javaEntity().getPersistentType(), javaJpaFile.rootStructureNodes().next()); + assertEquals(getJavaEntity().getPersistentType(), javaJpaFile.rootStructureNodes().next()); - ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); } public void testEntityMappingsRootStructureNodeRemoved() throws Exception { - IFile file = ormResource().getFile(); + IFile file = getOrmResource().getFile(); JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file); - assertEquals(entityMappings(), ormXmlJpaFile.rootStructureNodes().next()); + assertEquals(getEntityMappings(), ormXmlJpaFile.rootStructureNodes().next()); - ((OrmXml) entityMappings().getParent()).removeEntityMappings(); + ((OrmXml) getEntityMappings().getParent()).removeEntityMappings(); assertFalse(ormXmlJpaFile.rootStructureNodes().hasNext()); } public void testImpliedEntityMappingsRootStructureNodeRemoved() throws Exception { - IFile file = ormResource().getFile(); + IFile file = getOrmResource().getFile(); JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file); - assertNull(persistenceUnit().getImpliedMappingFileRef()); + assertNull(getPersistenceUnit().getImpliedMappingFileRef()); - xmlPersistenceUnit().getMappingFiles().remove(0); - assertNotNull(persistenceUnit().getImpliedMappingFileRef()); - assertEquals(persistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot(), ormXmlJpaFile.rootStructureNodes().next()); + getXmlPersistenceUnit().getMappingFiles().remove(0); + assertNotNull(getPersistenceUnit().getImpliedMappingFileRef()); + assertEquals(getPersistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot(), ormXmlJpaFile.rootStructureNodes().next()); - ((OrmXml) persistenceUnit().getImpliedMappingFileRef().getMappingFile()).removeEntityMappings(); + ((OrmXml) getPersistenceUnit().getImpliedMappingFileRef().getMappingFile()).removeEntityMappings(); assertFalse(ormXmlJpaFile.rootStructureNodes().hasNext()); } public void testEntityMappingsRootStructureNodeRemovedFromResourceModel() throws Exception { - IFile file = ormResource().getFile(); + IFile file = getOrmResource().getFile(); JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file); - assertEquals(entityMappings(), ormXmlJpaFile.rootStructureNodes().next()); + assertEquals(getEntityMappings(), ormXmlJpaFile.rootStructureNodes().next()); - ormResource().getContents().remove(ormResource().getEntityMappings()); + getOrmResource().getContents().remove(getOrmResource().getEntityMappings()); assertFalse(ormXmlJpaFile.rootStructureNodes().hasNext()); } public void testUpdatePersistenceRootStructureNodePersistenceRemoved() throws Exception { - IFile file = persistenceResource().getFile(); + IFile file = getPersistenceResource().getFile(); JpaFile persistenceXmlJpaFile = JptCorePlugin.getJpaFile(file); assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.rootStructureNodes().next()); @@ -129,7 +129,7 @@ public class JpaFileTests extends ContextModelTestCase } public void testUpdateOrmJavaRootStructureNodePersistenceRemoved() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -146,25 +146,25 @@ public class JpaFileTests extends ContextModelTestCase JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); - assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next()); + assertEquals(getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); getRootContextNode().getPersistenceXml().removePersistence(); assertFalse(javaJpaFile.rootStructureNodes().hasNext()); } public void testPersistenceRootStructureNodeRemovedFromResourceModel() throws Exception { - IFile file = persistenceResource().getFile(); + IFile file = getPersistenceResource().getFile(); JpaFile persistenceXmlJpaFile = JptCorePlugin.getJpaFile(file); getRootContextNode().getPersistenceXml().getPersistence(); assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.rootStructureNodes().next()); - persistenceResource().getContents().remove(persistenceResource().getPersistence()); + getPersistenceResource().getContents().remove(getPersistenceResource().getPersistence()); assertFalse(persistenceXmlJpaFile.rootStructureNodes().hasNext()); } public void testUpdateOrmJavaRootStructureNodePersistenceXmlRemoved() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -181,14 +181,14 @@ public class JpaFileTests extends ContextModelTestCase JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); - assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next()); + assertEquals(getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); getRootContextNode().removePersistenceXml(); assertFalse(javaJpaFile.rootStructureNodes().hasNext()); } public void testOrmJavaPersistentTypeRootStructureNodeRemoved() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -197,7 +197,7 @@ public class JpaFileTests extends ContextModelTestCase assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof OrmEntity); - entityMappings().removeOrmPersistentType(0); + getEntityMappings().removeOrmPersistentType(0); assertEquals(1, javaJpaFile.rootStructureNodesSize()); assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof ClassRef); @@ -205,7 +205,7 @@ public class JpaFileTests extends ContextModelTestCase } public void testOrmJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -214,7 +214,7 @@ public class JpaFileTests extends ContextModelTestCase assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof OrmEntity); - ormResource().getEntityMappings().getEntities().remove(0); + getOrmResource().getEntityMappings().getEntities().remove(0); assertEquals(1, javaJpaFile.rootStructureNodesSize()); assertTrue(javaJpaFile.rootStructureNodes().next().getParent() instanceof ClassRef); @@ -226,13 +226,13 @@ public class JpaFileTests extends ContextModelTestCase JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaPersistentType javaPersistentType = javaPersistentType(); + JavaPersistentType javaPersistentType = getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - assertEquals(entityMappings().getPersistenceUnit().specifiedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getEntityMappings().getPersistenceUnit().specifiedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); - entityMappings().getPersistenceUnit().removeSpecifiedClassRef(0); + getEntityMappings().getPersistenceUnit().removeSpecifiedClassRef(0); assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getEntityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); } public void testJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception { @@ -240,24 +240,24 @@ public class JpaFileTests extends ContextModelTestCase JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaPersistentType javaPersistentType = javaPersistentType(); + JavaPersistentType javaPersistentType = getJavaPersistentType(); Iterator<JpaStructureNode> rootStructureNodes = javaJpaFile.rootStructureNodes(); JpaStructureNode rootStructureNode = rootStructureNodes.next(); assertEquals(javaPersistentType, rootStructureNode); - assertEquals(entityMappings().getPersistenceUnit().specifiedClassRefs().next(), rootStructureNode.getParent()); + assertEquals(getEntityMappings().getPersistenceUnit().specifiedClassRefs().next(), rootStructureNode.getParent()); assertFalse(rootStructureNodes.hasNext()); removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getEntityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); } public void testImpliedJavaPersistentTypeRootStructureNodeRemoved() throws Exception { - jpaProject().setDiscoversAnnotatedClasses(true); + getJpaProject().setDiscoversAnnotatedClasses(true); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); - JavaPersistentType javaPersistentType = persistenceUnit().impliedClassRefs().next().getJavaPersistentType(); + JavaPersistentType javaPersistentType = getPersistenceUnit().impliedClassRefs().next().getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); javaPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); @@ -266,7 +266,7 @@ public class JpaFileTests extends ContextModelTestCase } public void testJavaRootStructureNodesEntityMappingsRemoved() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -274,14 +274,14 @@ public class JpaFileTests extends ContextModelTestCase JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - ormResource().getContents().remove(ormResource().getEntityMappings()); + getOrmResource().getContents().remove(getOrmResource().getEntityMappings()); assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next()); assertEquals(1, javaJpaFile.rootStructureNodesSize()); - assertEquals(persistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); } public void testJavaRootStructureNodesPersistenceUnitRemovedFromResourceModel() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -289,14 +289,14 @@ public class JpaFileTests extends ContextModelTestCase JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - persistenceResource().getPersistence().getPersistenceUnits().remove(0); + getPersistenceResource().getPersistence().getPersistenceUnits().remove(0); assertFalse(javaJpaFile.rootStructureNodes().hasNext()); assertEquals(0, javaJpaFile.rootStructureNodesSize()); } public void testJavaRootStructureNodesPersistenceUnitRemoved() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -304,14 +304,14 @@ public class JpaFileTests extends ContextModelTestCase JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - jpaProject().getRootContextNode().getPersistenceXml().getPersistence().removePersistenceUnit(0); + getJpaProject().getRootContextNode().getPersistenceXml().getPersistence().removePersistenceUnit(0); assertFalse(javaJpaFile.rootStructureNodes().hasNext()); assertEquals(0, javaJpaFile.rootStructureNodesSize()); } public void testJavaRootStructureNodesOrmPersistentTypeRemoved() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -319,14 +319,14 @@ public class JpaFileTests extends ContextModelTestCase JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - entityMappings().removeOrmPersistentType(0); + getEntityMappings().removeOrmPersistentType(0); assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next()); assertEquals(1, javaJpaFile.rootStructureNodesSize()); - assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getEntityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); } public void testJavaRootStructureNodesOrmTypeMappingMorphed() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -336,30 +336,30 @@ public class JpaFileTests extends ContextModelTestCase ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); assertEquals(1, javaJpaFile.rootStructureNodesSize()); - javaPersistentType = entityMappings().ormPersistentTypes().next().getJavaPersistentType(); + javaPersistentType = getEntityMappings().ormPersistentTypes().next().getJavaPersistentType(); assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - entityMappings().removeOrmPersistentType(0); + getEntityMappings().removeOrmPersistentType(0); assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next()); assertEquals(1, javaJpaFile.rootStructureNodesSize()); - assertEquals(entityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getEntityMappings().getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); } public void testUpdateOrmJavaRootStructureNodeMappingFileRefChanged() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); - MappingFileRef mappingFileRef = persistenceUnit().mappingFileRefs().next(); + MappingFileRef mappingFileRef = getPersistenceUnit().mappingFileRefs().next(); mappingFileRef.setFileName("foo"); - ormPersistentType = ((EntityMappings) persistenceUnit().getImpliedMappingFileRef().getMappingFile().getMappingFileRoot()).ormPersistentTypes().next(); + ormPersistentType = ((EntityMappings) getPersistenceUnit().getImpliedMappingFileRef().getMappingFile().getMappingFileRoot()).ormPersistentTypes().next(); assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); - IFile file = persistenceResource().getFile(); + IFile file = getPersistenceResource().getFile(); JpaFile ormXmlJpaFile = JptCorePlugin.getJpaFile(file); assertEquals(1, ormXmlJpaFile.rootStructureNodesSize()); @@ -371,16 +371,16 @@ public class JpaFileTests extends ContextModelTestCase JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); - assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next()); + assertEquals(getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); - MappingFileRef mappingFileRef = persistenceUnit().mappingFileRefs().next(); + MappingFileRef mappingFileRef = getPersistenceUnit().mappingFileRefs().next(); mappingFileRef.setFileName("foo"); - assertEquals(javaPersistentType(), javaJpaFile.rootStructureNodes().next()); + assertEquals(getJavaPersistentType(), javaJpaFile.rootStructureNodes().next()); } public void testUpdateJavaRootStrucutreNodeDeleteOrmResource() throws Exception { - 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); ICompilationUnit cu = createTestEntity(); JpaFile javaJpaFile = JptCorePlugin.getJpaFile((IFile) cu.getResource()); @@ -389,11 +389,11 @@ public class JpaFileTests extends ContextModelTestCase assertEquals(javaPersistentType, javaJpaFile.rootStructureNodes().next()); - deleteResource(ormResource()); + deleteResource(getOrmResource()); assertNotSame(javaPersistentType, javaJpaFile.rootStructureNodes().next()); assertEquals(1, javaJpaFile.rootStructureNodesSize()); - assertEquals(persistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); + assertEquals(getPersistenceUnit().impliedClassRefs().next(), javaJpaFile.rootStructureNodes().next().getParent()); } //TODO test rootStructureNodes with a static inner class 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"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java index cc8b88427b..9c4466471a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java @@ -42,528 +42,528 @@ public class EntityMappingsTests 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); } public void testGetVersion() throws Exception { - assertEquals("1.0", entityMappings().getVersion()); + assertEquals("1.0", getEntityMappings().getVersion()); } public void testUpdateDescription() throws Exception { - assertNull(entityMappings().getDescription()); - assertNull(ormResource().getEntityMappings().getDescription()); + assertNull(getEntityMappings().getDescription()); + assertNull(getOrmResource().getEntityMappings().getDescription()); //set description in the resource model, verify context model updated - ormResource().getEntityMappings().setDescription("newDescription"); - assertEquals("newDescription", entityMappings().getDescription()); - assertEquals("newDescription", ormResource().getEntityMappings().getDescription()); + getOrmResource().getEntityMappings().setDescription("newDescription"); + assertEquals("newDescription", getEntityMappings().getDescription()); + assertEquals("newDescription", getOrmResource().getEntityMappings().getDescription()); //set description to null in the resource model - ormResource().getEntityMappings().setDescription(null); - assertNull(entityMappings().getDescription()); - assertNull(ormResource().getEntityMappings().getDescription()); + getOrmResource().getEntityMappings().setDescription(null); + assertNull(getEntityMappings().getDescription()); + assertNull(getOrmResource().getEntityMappings().getDescription()); } public void testModifyDescription() throws Exception { - assertNull(entityMappings().getDescription()); - assertNull(ormResource().getEntityMappings().getDescription()); + assertNull(getEntityMappings().getDescription()); + assertNull(getOrmResource().getEntityMappings().getDescription()); //set description in the context model, verify resource model modified - entityMappings().setDescription("newDescription"); - assertEquals("newDescription", entityMappings().getDescription()); - assertEquals("newDescription", ormResource().getEntityMappings().getDescription()); + getEntityMappings().setDescription("newDescription"); + assertEquals("newDescription", getEntityMappings().getDescription()); + assertEquals("newDescription", getOrmResource().getEntityMappings().getDescription()); //set description to null in the context model - entityMappings().setDescription(null); - assertNull(entityMappings().getDescription()); - assertNull(ormResource().getEntityMappings().getDescription()); + getEntityMappings().setDescription(null); + assertNull(getEntityMappings().getDescription()); + assertNull(getOrmResource().getEntityMappings().getDescription()); } public void testUpdatePackage() throws Exception { - assertNull(entityMappings().getPackage()); - assertNull(ormResource().getEntityMappings().getPackage()); + assertNull(getEntityMappings().getPackage()); + assertNull(getOrmResource().getEntityMappings().getPackage()); //set package in the resource model, verify context model updated - ormResource().getEntityMappings().setPackage("foo.model"); - assertEquals("foo.model", entityMappings().getPackage()); - assertEquals("foo.model", ormResource().getEntityMappings().getPackage()); + getOrmResource().getEntityMappings().setPackage("foo.model"); + assertEquals("foo.model", getEntityMappings().getPackage()); + assertEquals("foo.model", getOrmResource().getEntityMappings().getPackage()); //set package to null in the resource model - ormResource().getEntityMappings().setPackage(null); - assertNull(entityMappings().getPackage()); - assertNull(ormResource().getEntityMappings().getPackage()); + getOrmResource().getEntityMappings().setPackage(null); + assertNull(getEntityMappings().getPackage()); + assertNull(getOrmResource().getEntityMappings().getPackage()); } public void testModifyPackage() throws Exception { - assertNull(entityMappings().getPackage()); - assertNull(ormResource().getEntityMappings().getPackage()); + assertNull(getEntityMappings().getPackage()); + assertNull(getOrmResource().getEntityMappings().getPackage()); //set package in the context model, verify resource model modified - entityMappings().setPackage("foo.model"); - assertEquals("foo.model", entityMappings().getPackage()); - assertEquals("foo.model", ormResource().getEntityMappings().getPackage()); + getEntityMappings().setPackage("foo.model"); + assertEquals("foo.model", getEntityMappings().getPackage()); + assertEquals("foo.model", getOrmResource().getEntityMappings().getPackage()); //set package to null in the context model - entityMappings().setPackage(null); - assertNull(entityMappings().getPackage()); - assertNull(ormResource().getEntityMappings().getPackage()); + getEntityMappings().setPackage(null); + assertNull(getEntityMappings().getPackage()); + assertNull(getOrmResource().getEntityMappings().getPackage()); } public void testUpdateSpecifiedSchema() throws Exception { - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); //set schema in the resource model, verify context model updated - ormResource().getEntityMappings().setSchema("MY_SCHEMA"); - assertEquals("MY_SCHEMA", entityMappings().getSpecifiedSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getSchema()); + getOrmResource().getEntityMappings().setSchema("MY_SCHEMA"); + assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getSchema()); //set schema to null in the resource model - ormResource().getEntityMappings().setSchema(null); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + getOrmResource().getEntityMappings().setSchema(null); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); } public void testModifySpecifiedSchema() throws Exception { - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); //set schema in the context model, verify resource model modified - entityMappings().setSpecifiedSchema("MY_SCHEMA"); - assertEquals("MY_SCHEMA", entityMappings().getSpecifiedSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getSchema()); + getEntityMappings().setSpecifiedSchema("MY_SCHEMA"); + assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getSchema()); //set schema to null in the context model - entityMappings().setSpecifiedSchema(null); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + getEntityMappings().setSpecifiedSchema(null); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); } public void testUpdateSpecifiedCatalog() throws Exception { - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); //set catalog in the resource model, verify context model updated - ormResource().getEntityMappings().setCatalog("MY_CATALOG"); - assertEquals("MY_CATALOG", entityMappings().getSpecifiedCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getCatalog()); + getOrmResource().getEntityMappings().setCatalog("MY_CATALOG"); + assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getCatalog()); //set catalog to null in the resource model - ormResource().getEntityMappings().setCatalog(null); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + getOrmResource().getEntityMappings().setCatalog(null); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); } public void testUpdateDefaultSchema() throws Exception { - assertNull(entityMappings().getDefaultSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + assertNull(getEntityMappings().getDefaultSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults(); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults); persistenceUnitDefaults.setSchema("MY_SCHEMA"); - assertEquals("MY_SCHEMA", entityMappings().getDefaultSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertEquals("MY_SCHEMA", getEntityMappings().getDefaultSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); persistenceUnitDefaults.setSchema(null); - assertNull(entityMappings().getDefaultSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertNull(getEntityMappings().getDefaultSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); } public void testUpdateSchema() throws Exception { - assertNull(entityMappings().getDefaultSchema()); - assertNull(entityMappings().getSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + assertNull(getEntityMappings().getDefaultSchema()); + assertNull(getEntityMappings().getSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); - ormResource().getEntityMappings().setSchema("MY_SCHEMA"); - assertNull(entityMappings().getDefaultSchema()); - assertEquals("MY_SCHEMA", entityMappings().getSchema()); - assertEquals("MY_SCHEMA", entityMappings().getSpecifiedSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getSchema()); - - ormResource().getEntityMappings().setSchema(null); - assertNull(entityMappings().getDefaultSchema()); - assertNull(entityMappings().getSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + getOrmResource().getEntityMappings().setSchema("MY_SCHEMA"); + assertNull(getEntityMappings().getDefaultSchema()); + assertEquals("MY_SCHEMA", getEntityMappings().getSchema()); + assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getSchema()); + + getOrmResource().getEntityMappings().setSchema(null); + assertNull(getEntityMappings().getDefaultSchema()); + assertNull(getEntityMappings().getSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("DEFAULT_SCHEMA"); - assertEquals("DEFAULT_SCHEMA", entityMappings().getDefaultSchema()); - assertEquals("DEFAULT_SCHEMA", entityMappings().getSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); - - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); - assertNull(entityMappings().getDefaultSchema()); - assertNull(entityMappings().getSchema()); - assertNull(entityMappings().getSpecifiedSchema()); - assertNull(ormResource().getEntityMappings().getSchema()); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("DEFAULT_SCHEMA"); + assertEquals("DEFAULT_SCHEMA", getEntityMappings().getDefaultSchema()); + assertEquals("DEFAULT_SCHEMA", getEntityMappings().getSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); + + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); + assertNull(getEntityMappings().getDefaultSchema()); + assertNull(getEntityMappings().getSchema()); + assertNull(getEntityMappings().getSpecifiedSchema()); + assertNull(getOrmResource().getEntityMappings().getSchema()); } public void testModifySpecifiedCatalog() throws Exception { - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); //set catalog in the context model, verify resource model modified - entityMappings().setSpecifiedCatalog("MY_CATALOG"); - assertEquals("MY_CATALOG", entityMappings().getSpecifiedCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getCatalog()); + getEntityMappings().setSpecifiedCatalog("MY_CATALOG"); + assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getCatalog()); //set catalog to null in the context model - entityMappings().setSpecifiedCatalog(null); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + getEntityMappings().setSpecifiedCatalog(null); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); } public void testUpdateDefaultCatalog() throws Exception { - assertNull(entityMappings().getDefaultCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getDefaultCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults(); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults); persistenceUnitDefaults.setCatalog("MY_CATALOG"); - assertEquals("MY_CATALOG", entityMappings().getDefaultCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertEquals("MY_CATALOG", getEntityMappings().getDefaultCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); persistenceUnitDefaults.setCatalog(null); - assertNull(entityMappings().getDefaultCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertNull(getEntityMappings().getDefaultCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); } public void testUpdateCatalog() throws Exception { - assertNull(entityMappings().getDefaultCatalog()); - assertNull(entityMappings().getCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getDefaultCatalog()); + assertNull(getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); - ormResource().getEntityMappings().setCatalog("MY_CATALOG"); - assertNull(entityMappings().getDefaultCatalog()); - assertEquals("MY_CATALOG", entityMappings().getCatalog()); - assertEquals("MY_CATALOG", entityMappings().getSpecifiedCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getCatalog()); - - ormResource().getEntityMappings().setCatalog(null); - assertNull(entityMappings().getDefaultCatalog()); - assertNull(entityMappings().getCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + getOrmResource().getEntityMappings().setCatalog("MY_CATALOG"); + assertNull(getEntityMappings().getDefaultCatalog()); + assertEquals("MY_CATALOG", getEntityMappings().getCatalog()); + assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getCatalog()); + + getOrmResource().getEntityMappings().setCatalog(null); + assertNull(getEntityMappings().getDefaultCatalog()); + assertNull(getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("DEFAULT_CATALOG"); - assertEquals("DEFAULT_CATALOG", entityMappings().getDefaultCatalog()); - assertEquals("DEFAULT_CATALOG", entityMappings().getCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); - - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); - assertNull(entityMappings().getDefaultCatalog()); - assertNull(entityMappings().getCatalog()); - assertNull(entityMappings().getSpecifiedCatalog()); - assertNull(ormResource().getEntityMappings().getCatalog()); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("DEFAULT_CATALOG"); + assertEquals("DEFAULT_CATALOG", getEntityMappings().getDefaultCatalog()); + assertEquals("DEFAULT_CATALOG", getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); + + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); + assertNull(getEntityMappings().getDefaultCatalog()); + assertNull(getEntityMappings().getCatalog()); + assertNull(getEntityMappings().getSpecifiedCatalog()); + assertNull(getOrmResource().getEntityMappings().getCatalog()); } public void testUpdateSpecifiedAccess() throws Exception { - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); //set access in the resource model, verify context model updated - ormResource().getEntityMappings().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY); - assertEquals(AccessType.PROPERTY, entityMappings().getSpecifiedAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, ormResource().getEntityMappings().getAccess()); + getOrmResource().getEntityMappings().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY); + assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, getOrmResource().getEntityMappings().getAccess()); //set access to null in the resource model - ormResource().getEntityMappings().setAccess(null); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + getOrmResource().getEntityMappings().setAccess(null); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); } public void testModifySpecifiedAccess() throws Exception { - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); //set access in the context model, verify resource model modified - entityMappings().setSpecifiedAccess(AccessType.PROPERTY); - assertEquals(AccessType.PROPERTY, entityMappings().getSpecifiedAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, ormResource().getEntityMappings().getAccess()); + getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY); + assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, getOrmResource().getEntityMappings().getAccess()); //set access to null in the context model - entityMappings().setSpecifiedAccess(null); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + getEntityMappings().setSpecifiedAccess(null); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); } public void testUpdateDefaultAccess() throws Exception { - assertNull(entityMappings().getDefaultAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertNull(getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults(); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults); persistenceUnitDefaults.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY); - assertEquals(AccessType.PROPERTY, entityMappings().getDefaultAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertEquals(AccessType.PROPERTY, getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); persistenceUnitDefaults.setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); - assertEquals(AccessType.FIELD, entityMappings().getDefaultAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); persistenceUnitDefaults.setAccess(null); - assertNull(entityMappings().getDefaultAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertNull(getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); } public void testUpdateAccess() throws Exception { - assertNull(entityMappings().getAccess()); - assertNull(entityMappings().getDefaultAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + assertNull(getEntityMappings().getAccess()); + assertNull(getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); - ormResource().getEntityMappings().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); - assertNull(entityMappings().getDefaultAccess()); - assertEquals(AccessType.FIELD, entityMappings().getAccess()); - assertEquals(AccessType.FIELD, entityMappings().getSpecifiedAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, ormResource().getEntityMappings().getAccess()); - - ormResource().getEntityMappings().setAccess(null); - assertNull(entityMappings().getAccess()); - assertNull(entityMappings().getDefaultAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + getOrmResource().getEntityMappings().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); + assertNull(getEntityMappings().getDefaultAccess()); + assertEquals(AccessType.FIELD, getEntityMappings().getAccess()); + assertEquals(AccessType.FIELD, getEntityMappings().getSpecifiedAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, getOrmResource().getEntityMappings().getAccess()); + + getOrmResource().getEntityMappings().setAccess(null); + assertNull(getEntityMappings().getAccess()); + assertNull(getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); - assertEquals(AccessType.FIELD, entityMappings().getDefaultAccess()); - assertEquals(AccessType.FIELD, entityMappings().getAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); - - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); - assertNull(entityMappings().getDefaultAccess()); - assertNull(entityMappings().getAccess()); - assertNull(entityMappings().getSpecifiedAccess()); - assertNull(ormResource().getEntityMappings().getAccess()); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); + assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess()); + assertEquals(AccessType.FIELD, getEntityMappings().getAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); + + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); + assertNull(getEntityMappings().getDefaultAccess()); + assertNull(getEntityMappings().getAccess()); + assertNull(getEntityMappings().getSpecifiedAccess()); + assertNull(getOrmResource().getEntityMappings().getAccess()); } public void testUpdateOrmPersistentTypes() throws Exception { - assertFalse(entityMappings().ormPersistentTypes().hasNext()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty()); + assertFalse(getEntityMappings().ormPersistentTypes().hasNext()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); //add embeddable in the resource model, verify context model updated XmlEmbeddable embeddable = OrmFactory.eINSTANCE.createXmlEmbeddable(); - ormResource().getEntityMappings().getEmbeddables().add(embeddable); + getOrmResource().getEntityMappings().getEmbeddables().add(embeddable); embeddable.setClassName("model.Foo"); - assertTrue(entityMappings().ormPersistentTypes().hasNext()); - assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName()); + assertTrue(getEntityMappings().ormPersistentTypes().hasNext()); + assertEquals("model.Foo", getEntityMappings().ormPersistentTypes().next().getMapping().getClass_()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + assertEquals("model.Foo", getOrmResource().getEntityMappings().getEmbeddables().get(0).getClassName()); //add entity in the resource model, verify context model updated XmlEntity entity = OrmFactory.eINSTANCE.createXmlEntity(); - ormResource().getEntityMappings().getEntities().add(entity); + getOrmResource().getEntityMappings().getEntities().add(entity); entity.setClassName("model.Foo2"); - assertTrue(entityMappings().ormPersistentTypes().hasNext()); - assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName()); + assertTrue(getEntityMappings().ormPersistentTypes().hasNext()); + assertEquals("model.Foo2", getEntityMappings().ormPersistentTypes().next().getMapping().getClass_()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + assertEquals("model.Foo2", getOrmResource().getEntityMappings().getEntities().get(0).getClassName()); //add mapped-superclass in the resource model, verify context model updated XmlMappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createXmlMappedSuperclass(); - ormResource().getEntityMappings().getMappedSuperclasses().add(mappedSuperclass); + getOrmResource().getEntityMappings().getMappedSuperclasses().add(mappedSuperclass); mappedSuperclass.setClassName("model.Foo3"); - assertTrue(entityMappings().ormPersistentTypes().hasNext()); - assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_()); - assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName()); + assertTrue(getEntityMappings().ormPersistentTypes().hasNext()); + assertEquals("model.Foo3", getEntityMappings().ormPersistentTypes().next().getMapping().getClass_()); + assertFalse(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + assertEquals("model.Foo3", getOrmResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName()); } public void testAddOrmPersistentType() throws Exception { - assertFalse(entityMappings().ormPersistentTypes().hasNext()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty()); + assertFalse(getEntityMappings().ormPersistentTypes().hasNext()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); //add embeddable in the context model, verify resource model modified - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); - assertTrue(entityMappings().ormPersistentTypes().hasNext()); - assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_()); - assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, entityMappings().ormPersistentTypes().next().getMapping().getKey()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName()); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + assertTrue(getEntityMappings().ormPersistentTypes().hasNext()); + assertEquals("model.Foo", getEntityMappings().ormPersistentTypes().next().getMapping().getClass_()); + assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getEntityMappings().ormPersistentTypes().next().getMapping().getKey()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + assertEquals("model.Foo", getOrmResource().getEntityMappings().getEmbeddables().get(0).getClassName()); //add entity in the context model, verify resource model modified - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - assertTrue(entityMappings().ormPersistentTypes().hasNext()); - assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_()); - assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, entityMappings().ormPersistentTypes().next().getMapping().getKey()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName()); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + assertTrue(getEntityMappings().ormPersistentTypes().hasNext()); + assertEquals("model.Foo2", getEntityMappings().ormPersistentTypes().next().getMapping().getClass_()); + assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getEntityMappings().ormPersistentTypes().next().getMapping().getKey()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + assertEquals("model.Foo2", getOrmResource().getEntityMappings().getEntities().get(0).getClassName()); //add mapped-superclass in the context model, verify resource model modified - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3"); - assertTrue(entityMappings().ormPersistentTypes().hasNext()); - assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_()); - assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, entityMappings().ormPersistentTypes().next().getMapping().getKey()); - assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName()); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3"); + assertTrue(getEntityMappings().ormPersistentTypes().hasNext()); + assertEquals("model.Foo3", getEntityMappings().ormPersistentTypes().next().getMapping().getClass_()); + assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, getEntityMappings().ormPersistentTypes().next().getMapping().getKey()); + assertFalse(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + assertEquals("model.Foo3", getOrmResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName()); } public void testRemoveOrmPersistentType() throws Exception { - assertFalse(entityMappings().ormPersistentTypes().hasNext()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty()); + assertFalse(getEntityMappings().ormPersistentTypes().hasNext()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3"); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3"); //remove ormPersistentType from the context model, verify resource model modified - entityMappings().removeOrmPersistentType(1); - assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - - entityMappings().removeOrmPersistentType(1); - assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - - entityMappings().removeOrmPersistentType(0); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty()); + getEntityMappings().removeOrmPersistentType(1); + assertFalse(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertFalse(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + + getEntityMappings().removeOrmPersistentType(1); + assertFalse(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + + getEntityMappings().removeOrmPersistentType(0); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); } public void testUpdateTableGenerators() throws Exception { - assertEquals(0, entityMappings().tableGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(0, getEntityMappings().tableGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getTableGenerators().size()); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); XmlTableGenerator tableGeneratorResource = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl(); - ormResource().getEntityMappings().getTableGenerators().add(tableGeneratorResource); + getOrmResource().getEntityMappings().getTableGenerators().add(tableGeneratorResource); tableGeneratorResource.setName("FOO"); - TableGenerator tableGenerator = entityMappings().tableGenerators().next(); + TableGenerator tableGenerator = getEntityMappings().tableGenerators().next(); assertEquals("FOO", tableGenerator.getName()); - assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); XmlTableGenerator tableGeneratorResource2 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl(); - ormResource().getEntityMappings().getTableGenerators().add(0, tableGeneratorResource2); + getOrmResource().getEntityMappings().getTableGenerators().add(0, tableGeneratorResource2); tableGeneratorResource2.setName("BAR"); - ListIterator<OrmTableGenerator> tableGenerators = entityMappings().tableGenerators(); + ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().tableGenerators(); assertEquals("BAR", tableGenerators.next().getName()); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); XmlTableGenerator tableGeneratorResource3 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl(); - ormResource().getEntityMappings().getTableGenerators().add(1, tableGeneratorResource3); + getOrmResource().getEntityMappings().getTableGenerators().add(1, tableGeneratorResource3); tableGeneratorResource3.setName("BAZ"); - tableGenerators = entityMappings().tableGenerators(); + tableGenerators = getEntityMappings().tableGenerators(); assertEquals("BAR", tableGenerators.next().getName()); assertEquals("BAZ", tableGenerators.next().getName()); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(3, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getTableGenerators().move(2, 0); - tableGenerators = entityMappings().tableGenerators(); + getOrmResource().getEntityMappings().getTableGenerators().move(2, 0); + tableGenerators = getEntityMappings().tableGenerators(); assertEquals("BAZ", tableGenerators.next().getName()); assertEquals("FOO", tableGenerators.next().getName()); assertEquals("BAR", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(3, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getTableGenerators().remove(0); - tableGenerators = entityMappings().tableGenerators(); + getOrmResource().getEntityMappings().getTableGenerators().remove(0); + tableGenerators = getEntityMappings().tableGenerators(); assertEquals("FOO", tableGenerators.next().getName()); assertEquals("BAR", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getTableGenerators().remove(1); - tableGenerators = entityMappings().tableGenerators(); + getOrmResource().getEntityMappings().getTableGenerators().remove(1); + tableGenerators = getEntityMappings().tableGenerators(); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getTableGenerators().clear(); - tableGenerators = entityMappings().tableGenerators(); + getOrmResource().getEntityMappings().getTableGenerators().clear(); + tableGenerators = getEntityMappings().tableGenerators(); assertFalse(tableGenerators.hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { - assertEquals(0, entityMappings().tableGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); - entityMappings().addTableGenerator(0).setName("FOO"); + assertEquals(0, getEntityMappings().tableGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getTableGenerators().size()); + getEntityMappings().addTableGenerator(0).setName("FOO"); - assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); - entityMappings().addTableGenerator(0).setName("BAR"); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(1).getName()); - assertEquals(2, ormResource().getEntityMappings().getTableGenerators().size()); + getEntityMappings().addTableGenerator(0).setName("BAR"); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getTableGenerators().get(1).getName()); + assertEquals(2, getOrmResource().getEntityMappings().getTableGenerators().size()); - ListIterator<OrmTableGenerator> tableGenerators = entityMappings().tableGenerators(); + ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().tableGenerators(); assertEquals("BAR", tableGenerators.next().getName()); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); } public void testRemoveTableGenerator() throws Exception { - assertEquals(0, entityMappings().tableGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); + assertEquals(0, getEntityMappings().tableGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getTableGenerators().size()); - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); tableGenerator.setName("FOO"); - TableGenerator tableGenerator2 = entityMappings().addTableGenerator(1); + TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1); tableGenerator2.setName("BAR"); - TableGenerator tableGenerator3 = entityMappings().addTableGenerator(2); + TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2); tableGenerator3.setName("BAZ"); - assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(1).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size()); + assertEquals("FOO", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(1).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getTableGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getTableGenerators().size()); - entityMappings().removeTableGenerator(0); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(1).getName()); + getEntityMappings().removeTableGenerator(0); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getTableGenerators().get(1).getName()); - ListIterator<OrmTableGenerator> tableGenerators = entityMappings().tableGenerators(); + ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().tableGenerators(); OrmTableGenerator xmlTableGenerator = tableGenerators.next(); assertEquals("BAR", xmlTableGenerator.getName()); assertEquals(tableGenerator2, xmlTableGenerator); @@ -573,166 +573,166 @@ public class EntityMappingsTests extends ContextModelTestCase assertFalse(tableGenerators.hasNext()); - entityMappings().removeTableGenerator(1); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - tableGenerators = entityMappings().tableGenerators(); + getEntityMappings().removeTableGenerator(1); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + tableGenerators = getEntityMappings().tableGenerators(); xmlTableGenerator = tableGenerators.next(); assertEquals("BAR", xmlTableGenerator.getName()); assertEquals(tableGenerator2, xmlTableGenerator); assertFalse(tableGenerators.hasNext()); - entityMappings().removeTableGenerator(0); - assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); - tableGenerators = entityMappings().tableGenerators(); + getEntityMappings().removeTableGenerator(0); + assertEquals(0, getOrmResource().getEntityMappings().getTableGenerators().size()); + tableGenerators = getEntityMappings().tableGenerators(); assertFalse(tableGenerators.hasNext()); } public void testMoveTableGenerator() throws Exception { - assertEquals(0, entityMappings().tableGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); + assertEquals(0, getEntityMappings().tableGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getTableGenerators().size()); - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); tableGenerator.setName("FOO"); - TableGenerator tableGenerator2 = entityMappings().addTableGenerator(1); + TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1); tableGenerator2.setName("BAR"); - TableGenerator tableGenerator3 = entityMappings().addTableGenerator(2); + TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2); tableGenerator3.setName("BAZ"); - assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(1).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size()); - - entityMappings().moveTableGenerator(2, 0); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size()); - - entityMappings().moveTableGenerator(0, 2); - assertEquals("FOO", ormResource().getEntityMappings().getTableGenerators().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getTableGenerators().get(1).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getTableGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getTableGenerators().size()); + assertEquals("FOO", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(1).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getTableGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getTableGenerators().size()); + + getEntityMappings().moveTableGenerator(2, 0); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getTableGenerators().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getTableGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getTableGenerators().size()); + + getEntityMappings().moveTableGenerator(0, 2); + assertEquals("FOO", getOrmResource().getEntityMappings().getTableGenerators().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getTableGenerators().get(1).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getTableGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getTableGenerators().size()); } public void testTableGeneratorsSize() throws Exception { - assertEquals(0, entityMappings().tableGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); + assertEquals(0, getEntityMappings().tableGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getTableGenerators().size()); - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); tableGenerator.setName("FOO"); - TableGenerator tableGenerator2 = entityMappings().addTableGenerator(1); + TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1); tableGenerator2.setName("BAR"); - TableGenerator tableGenerator3 = entityMappings().addTableGenerator(2); + TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2); tableGenerator3.setName("BAZ"); - assertEquals(3, entityMappings().tableGeneratorsSize()); + assertEquals(3, getEntityMappings().tableGeneratorsSize()); - ormResource().getEntityMappings().getTableGenerators().remove(0); - assertEquals(2, entityMappings().tableGeneratorsSize()); + getOrmResource().getEntityMappings().getTableGenerators().remove(0); + assertEquals(2, getEntityMappings().tableGeneratorsSize()); } public void testUpdateSequenceGenerators() throws Exception { - assertEquals(0, entityMappings().sequenceGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(0, getEntityMappings().sequenceGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); XmlSequenceGenerator sequenceGeneratorResource = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl(); - ormResource().getEntityMappings().getSequenceGenerators().add(sequenceGeneratorResource); + getOrmResource().getEntityMappings().getSequenceGenerators().add(sequenceGeneratorResource); sequenceGeneratorResource.setName("FOO"); - SequenceGenerator sequenceGenerator = entityMappings().sequenceGenerators().next(); + SequenceGenerator sequenceGenerator = getEntityMappings().sequenceGenerators().next(); assertEquals("FOO", sequenceGenerator.getName()); - assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); XmlSequenceGenerator sequenceGeneratorResource2 = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl(); - ormResource().getEntityMappings().getSequenceGenerators().add(0, sequenceGeneratorResource2); + getOrmResource().getEntityMappings().getSequenceGenerators().add(0, sequenceGeneratorResource2); sequenceGeneratorResource2.setName("BAR"); - ListIterator<OrmSequenceGenerator> sequenceGenerators = entityMappings().sequenceGenerators(); + ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().sequenceGenerators(); assertEquals("BAR", sequenceGenerators.next().getName()); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); XmlSequenceGenerator sequenceGeneratorResource3 = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl(); - ormResource().getEntityMappings().getSequenceGenerators().add(1, sequenceGeneratorResource3); + getOrmResource().getEntityMappings().getSequenceGenerators().add(1, sequenceGeneratorResource3); sequenceGeneratorResource3.setName("BAZ"); - sequenceGenerators = entityMappings().sequenceGenerators(); + sequenceGenerators = getEntityMappings().sequenceGenerators(); assertEquals("BAR", sequenceGenerators.next().getName()); assertEquals("BAZ", sequenceGenerators.next().getName()); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(3, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getSequenceGenerators().move(2, 0); - sequenceGenerators = entityMappings().sequenceGenerators(); + getOrmResource().getEntityMappings().getSequenceGenerators().move(2, 0); + sequenceGenerators = getEntityMappings().sequenceGenerators(); assertEquals("BAZ", sequenceGenerators.next().getName()); assertEquals("FOO", sequenceGenerators.next().getName()); assertEquals("BAR", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - ormResource().getEntityMappings().getSequenceGenerators().remove(0); - sequenceGenerators = entityMappings().sequenceGenerators(); + getOrmResource().getEntityMappings().getSequenceGenerators().remove(0); + sequenceGenerators = getEntityMappings().sequenceGenerators(); assertEquals("FOO", sequenceGenerators.next().getName()); assertEquals("BAR", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getSequenceGenerators().remove(1); - sequenceGenerators = entityMappings().sequenceGenerators(); + getOrmResource().getEntityMappings().getSequenceGenerators().remove(1); + sequenceGenerators = getEntityMappings().sequenceGenerators(); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); - ormResource().getEntityMappings().getSequenceGenerators().clear(); - sequenceGenerators = entityMappings().sequenceGenerators(); + getOrmResource().getEntityMappings().getSequenceGenerators().clear(); + sequenceGenerators = getEntityMappings().sequenceGenerators(); assertFalse(sequenceGenerators.hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allGenerators())); } public void testAddSequenceGenerator() throws Exception { - assertEquals(0, entityMappings().sequenceGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals(0, getEntityMappings().sequenceGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getSequenceGenerators().size()); - entityMappings().addSequenceGenerator(0).setName("FOO"); + getEntityMappings().addSequenceGenerator(0).setName("FOO"); - assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - entityMappings().addSequenceGenerator(0).setName("BAR"); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName()); - assertEquals(2, ormResource().getEntityMappings().getSequenceGenerators().size()); + getEntityMappings().addSequenceGenerator(0).setName("BAR"); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getSequenceGenerators().get(1).getName()); + assertEquals(2, getOrmResource().getEntityMappings().getSequenceGenerators().size()); - ListIterator<OrmSequenceGenerator> sequenceGenerators = entityMappings().sequenceGenerators(); + ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().sequenceGenerators(); assertEquals("BAR", sequenceGenerators.next().getName()); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); } public void testRemoveSequenceGenerator() throws Exception { - assertEquals(0, entityMappings().sequenceGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals(0, getEntityMappings().sequenceGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getSequenceGenerators().size()); - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); sequenceGenerator.setName("FOO"); - SequenceGenerator sequenceGenerator2 = entityMappings().addSequenceGenerator(1); + SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1); sequenceGenerator2.setName("BAR"); - SequenceGenerator sequenceGenerator3 = entityMappings().addSequenceGenerator(2); + SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2); sequenceGenerator3.setName("BAZ"); - assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals("FOO", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(1).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getSequenceGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getSequenceGenerators().size()); - entityMappings().removeSequenceGenerator(0); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName()); + getEntityMappings().removeSequenceGenerator(0); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getSequenceGenerators().get(1).getName()); - ListIterator<OrmSequenceGenerator> sequenceGenerators = entityMappings().sequenceGenerators(); + ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().sequenceGenerators(); SequenceGenerator xmlSequenceGenerator = sequenceGenerators.next(); assertEquals("BAR", xmlSequenceGenerator.getName()); assertEquals(sequenceGenerator2, xmlSequenceGenerator); @@ -742,326 +742,326 @@ public class EntityMappingsTests extends ContextModelTestCase assertFalse(sequenceGenerators.hasNext()); - entityMappings().removeSequenceGenerator(1); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - sequenceGenerators = entityMappings().sequenceGenerators(); + getEntityMappings().removeSequenceGenerator(1); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + sequenceGenerators = getEntityMappings().sequenceGenerators(); xmlSequenceGenerator = sequenceGenerators.next(); assertEquals("BAR", xmlSequenceGenerator.getName()); assertEquals(sequenceGenerator2, xmlSequenceGenerator); assertFalse(sequenceGenerators.hasNext()); - entityMappings().removeSequenceGenerator(0); - assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); - sequenceGenerators = entityMappings().sequenceGenerators(); + getEntityMappings().removeSequenceGenerator(0); + assertEquals(0, getOrmResource().getEntityMappings().getSequenceGenerators().size()); + sequenceGenerators = getEntityMappings().sequenceGenerators(); assertFalse(sequenceGenerators.hasNext()); } public void testMoveSequenceGenerator() throws Exception { - assertEquals(0, entityMappings().sequenceGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals(0, getEntityMappings().sequenceGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getSequenceGenerators().size()); - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); sequenceGenerator.setName("FOO"); - SequenceGenerator sequenceGenerator2 = entityMappings().addSequenceGenerator(1); + SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1); sequenceGenerator2.setName("BAR"); - SequenceGenerator sequenceGenerator3 = entityMappings().addSequenceGenerator(2); + SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2); sequenceGenerator3.setName("BAZ"); - assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size()); - - entityMappings().moveSequenceGenerator(2, 0); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size()); - - entityMappings().moveSequenceGenerator(0, 2); - assertEquals("FOO", ormResource().getEntityMappings().getSequenceGenerators().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getSequenceGenerators().get(1).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getSequenceGenerators().get(2).getName()); - assertEquals(3, ormResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals("FOO", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(1).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getSequenceGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getSequenceGenerators().size()); + + getEntityMappings().moveSequenceGenerator(2, 0); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getSequenceGenerators().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getSequenceGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getSequenceGenerators().size()); + + getEntityMappings().moveSequenceGenerator(0, 2); + assertEquals("FOO", getOrmResource().getEntityMappings().getSequenceGenerators().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getSequenceGenerators().get(1).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getSequenceGenerators().get(2).getName()); + assertEquals(3, getOrmResource().getEntityMappings().getSequenceGenerators().size()); } public void testSequenceGeneratorsSize() throws Exception { - assertEquals(0, entityMappings().sequenceGeneratorsSize()); - assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); + assertEquals(0, getEntityMappings().sequenceGeneratorsSize()); + assertEquals(0, getOrmResource().getEntityMappings().getSequenceGenerators().size()); - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); sequenceGenerator.setName("FOO"); - SequenceGenerator sequenceGenerator2 = entityMappings().addSequenceGenerator(1); + SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1); sequenceGenerator2.setName("BAR"); - SequenceGenerator sequenceGenerator3 = entityMappings().addSequenceGenerator(2); + SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2); sequenceGenerator3.setName("BAZ"); - assertEquals(3, entityMappings().sequenceGeneratorsSize()); + assertEquals(3, getEntityMappings().sequenceGeneratorsSize()); - ormResource().getEntityMappings().getSequenceGenerators().remove(0); - assertEquals(2, entityMappings().sequenceGeneratorsSize()); + getOrmResource().getEntityMappings().getSequenceGenerators().remove(0); + assertEquals(2, getEntityMappings().sequenceGeneratorsSize()); } public void testAddNamedQuery() throws Exception { - OrmNamedQuery namedQuery = entityMappings().addNamedQuery(0); + OrmNamedQuery namedQuery = getEntityMappings().addNamedQuery(0); namedQuery.setName("FOO"); - assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); - OrmNamedQuery namedQuery2 = entityMappings().addNamedQuery(0); + OrmNamedQuery namedQuery2 = getEntityMappings().addNamedQuery(0); namedQuery2.setName("BAR"); - assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(1).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedQueries().get(1).getName()); - OrmNamedQuery namedQuery3 = entityMappings().addNamedQuery(1); + OrmNamedQuery namedQuery3 = getEntityMappings().addNamedQuery(1); namedQuery3.setName("BAZ"); - assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(2).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedQueries().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedQueries().get(2).getName()); - ListIterator<OrmNamedQuery> namedQueries = entityMappings().namedQueries(); + ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().namedQueries(); assertEquals(namedQuery2, namedQueries.next()); assertEquals(namedQuery3, namedQueries.next()); assertEquals(namedQuery, namedQueries.next()); - namedQueries = entityMappings().namedQueries(); + namedQueries = getEntityMappings().namedQueries(); assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); } public void testRemoveNamedQuery() throws Exception { - entityMappings().addNamedQuery(0).setName("FOO"); - entityMappings().addNamedQuery(1).setName("BAR"); - entityMappings().addNamedQuery(2).setName("BAZ"); + getEntityMappings().addNamedQuery(0).setName("FOO"); + getEntityMappings().addNamedQuery(1).setName("BAR"); + getEntityMappings().addNamedQuery(2).setName("BAZ"); - assertEquals(3, ormResource().getEntityMappings().getNamedQueries().size()); + assertEquals(3, getOrmResource().getEntityMappings().getNamedQueries().size()); - entityMappings().removeNamedQuery(0); - assertEquals(2, ormResource().getEntityMappings().getNamedQueries().size()); - assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(1).getName()); + getEntityMappings().removeNamedQuery(0); + assertEquals(2, getOrmResource().getEntityMappings().getNamedQueries().size()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedQueries().get(1).getName()); - entityMappings().removeNamedQuery(0); - assertEquals(1, ormResource().getEntityMappings().getNamedQueries().size()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); + getEntityMappings().removeNamedQuery(0); + assertEquals(1, getOrmResource().getEntityMappings().getNamedQueries().size()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); - entityMappings().removeNamedQuery(0); - assertEquals(0, ormResource().getEntityMappings().getNamedQueries().size()); + getEntityMappings().removeNamedQuery(0); + assertEquals(0, getOrmResource().getEntityMappings().getNamedQueries().size()); } public void testMoveNamedQuery() throws Exception { - entityMappings().addNamedQuery(0).setName("FOO"); - entityMappings().addNamedQuery(1).setName("BAR"); - entityMappings().addNamedQuery(2).setName("BAZ"); + getEntityMappings().addNamedQuery(0).setName("FOO"); + getEntityMappings().addNamedQuery(1).setName("BAR"); + getEntityMappings().addNamedQuery(2).setName("BAZ"); - assertEquals(3, ormResource().getEntityMappings().getNamedQueries().size()); + assertEquals(3, getOrmResource().getEntityMappings().getNamedQueries().size()); - entityMappings().moveNamedQuery(2, 0); - ListIterator<OrmNamedQuery> namedQueries = entityMappings().namedQueries(); + getEntityMappings().moveNamedQuery(2, 0); + ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().namedQueries(); assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); - assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(2).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedQueries().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedQueries().get(2).getName()); - entityMappings().moveNamedQuery(0, 1); - namedQueries = entityMappings().namedQueries(); + getEntityMappings().moveNamedQuery(0, 1); + namedQueries = getEntityMappings().namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertEquals("BAR", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedQueries().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getNamedQueries().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedQueries().get(2).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedQueries().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedQueries().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedQueries().get(2).getName()); } public void testUpdateNamedQueries() throws Exception { - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); - ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); - ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); + getOrmResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); + getOrmResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); + getOrmResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); - ormResource().getEntityMappings().getNamedQueries().get(0).setName("FOO"); - ormResource().getEntityMappings().getNamedQueries().get(1).setName("BAR"); - ormResource().getEntityMappings().getNamedQueries().get(2).setName("BAZ"); + getOrmResource().getEntityMappings().getNamedQueries().get(0).setName("FOO"); + getOrmResource().getEntityMappings().getNamedQueries().get(1).setName("BAR"); + getOrmResource().getEntityMappings().getNamedQueries().get(2).setName("BAZ"); - ListIterator<OrmNamedQuery> namedQueries = entityMappings().namedQueries(); + ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().namedQueries(); assertEquals("FOO", namedQueries.next().getName()); assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedQueries().move(2, 0); - namedQueries = entityMappings().namedQueries(); + getOrmResource().getEntityMappings().getNamedQueries().move(2, 0); + namedQueries = getEntityMappings().namedQueries(); assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - ormResource().getEntityMappings().getNamedQueries().move(0, 1); - namedQueries = entityMappings().namedQueries(); + getOrmResource().getEntityMappings().getNamedQueries().move(0, 1); + namedQueries = getEntityMappings().namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertEquals("BAR", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - ormResource().getEntityMappings().getNamedQueries().remove(1); - namedQueries = entityMappings().namedQueries(); + getOrmResource().getEntityMappings().getNamedQueries().remove(1); + namedQueries = getEntityMappings().namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedQueries().remove(1); - namedQueries = entityMappings().namedQueries(); + getOrmResource().getEntityMappings().getNamedQueries().remove(1); + namedQueries = getEntityMappings().namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedQueries().remove(0); - assertFalse(entityMappings().namedQueries().hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + getOrmResource().getEntityMappings().getNamedQueries().remove(0); + assertFalse(getEntityMappings().namedQueries().hasNext()); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); } public void testAddNamedNativeQuery() throws Exception { - OrmNamedNativeQuery namedNativeQuery = entityMappings().addNamedNativeQuery(0); + OrmNamedNativeQuery namedNativeQuery = getEntityMappings().addNamedNativeQuery(0); namedNativeQuery.setName("FOO"); - assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - OrmNamedNativeQuery namedNativeQuery2 = entityMappings().addNamedNativeQuery(0); + OrmNamedNativeQuery namedNativeQuery2 = getEntityMappings().addNamedNativeQuery(0); namedNativeQuery2.setName("BAR"); - assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); - OrmNamedNativeQuery namedNativeQuery3 = entityMappings().addNamedNativeQuery(1); + OrmNamedNativeQuery namedNativeQuery3 = getEntityMappings().addNamedNativeQuery(1); namedNativeQuery3.setName("BAZ"); - assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(2).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedNativeQueries().get(2).getName()); - ListIterator<OrmNamedNativeQuery> namedNativeQueries = entityMappings().namedNativeQueries(); + ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals(namedNativeQuery2, namedNativeQueries.next()); assertEquals(namedNativeQuery3, namedNativeQueries.next()); assertEquals(namedNativeQuery, namedNativeQueries.next()); - namedNativeQueries = entityMappings().namedNativeQueries(); + namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); } public void testRemoveNamedNativeQuery() throws Exception { - entityMappings().addNamedNativeQuery(0).setName("FOO"); - entityMappings().addNamedNativeQuery(1).setName("BAR"); - entityMappings().addNamedNativeQuery(2).setName("BAZ"); + getEntityMappings().addNamedNativeQuery(0).setName("FOO"); + getEntityMappings().addNamedNativeQuery(1).setName("BAR"); + getEntityMappings().addNamedNativeQuery(2).setName("BAZ"); - assertEquals(3, ormResource().getEntityMappings().getNamedNativeQueries().size()); + assertEquals(3, getOrmResource().getEntityMappings().getNamedNativeQueries().size()); - entityMappings().removeNamedNativeQuery(0); - assertEquals(2, ormResource().getEntityMappings().getNamedNativeQueries().size()); - assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); + getEntityMappings().removeNamedNativeQuery(0); + assertEquals(2, getOrmResource().getEntityMappings().getNamedNativeQueries().size()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); - entityMappings().removeNamedNativeQuery(0); - assertEquals(1, ormResource().getEntityMappings().getNamedNativeQueries().size()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + getEntityMappings().removeNamedNativeQuery(0); + assertEquals(1, getOrmResource().getEntityMappings().getNamedNativeQueries().size()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - entityMappings().removeNamedNativeQuery(0); - assertEquals(0, ormResource().getEntityMappings().getNamedNativeQueries().size()); + getEntityMappings().removeNamedNativeQuery(0); + assertEquals(0, getOrmResource().getEntityMappings().getNamedNativeQueries().size()); } public void testMoveNamedNativeQuery() throws Exception { - entityMappings().addNamedNativeQuery(0).setName("FOO"); - entityMappings().addNamedNativeQuery(1).setName("BAR"); - entityMappings().addNamedNativeQuery(2).setName("BAZ"); + getEntityMappings().addNamedNativeQuery(0).setName("FOO"); + getEntityMappings().addNamedNativeQuery(1).setName("BAR"); + getEntityMappings().addNamedNativeQuery(2).setName("BAZ"); - assertEquals(3, ormResource().getEntityMappings().getNamedNativeQueries().size()); + assertEquals(3, getOrmResource().getEntityMappings().getNamedNativeQueries().size()); - entityMappings().moveNamedNativeQuery(2, 0); - ListIterator<OrmNamedNativeQuery> namedNativeQueries = entityMappings().namedNativeQueries(); + getEntityMappings().moveNamedNativeQuery(2, 0); + ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); - assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(2).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedNativeQueries().get(2).getName()); - entityMappings().moveNamedNativeQuery(0, 1); - namedNativeQueries = entityMappings().namedNativeQueries(); + getEntityMappings().moveNamedNativeQuery(0, 1); + namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); - assertEquals("BAZ", ormResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); - assertEquals("BAR", ormResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); - assertEquals("FOO", ormResource().getEntityMappings().getNamedNativeQueries().get(2).getName()); + assertEquals("BAZ", getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).getName()); + assertEquals("BAR", getOrmResource().getEntityMappings().getNamedNativeQueries().get(1).getName()); + assertEquals("FOO", getOrmResource().getEntityMappings().getNamedNativeQueries().get(2).getName()); } public void testUpdateNamedNativeQueries() throws Exception { - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); - ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); - ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); + getOrmResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); + getOrmResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); + getOrmResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); - ormResource().getEntityMappings().getNamedNativeQueries().get(0).setName("FOO"); - ormResource().getEntityMappings().getNamedNativeQueries().get(1).setName("BAR"); - ormResource().getEntityMappings().getNamedNativeQueries().get(2).setName("BAZ"); + getOrmResource().getEntityMappings().getNamedNativeQueries().get(0).setName("FOO"); + getOrmResource().getEntityMappings().getNamedNativeQueries().get(1).setName("BAR"); + getOrmResource().getEntityMappings().getNamedNativeQueries().get(2).setName("BAZ"); - ListIterator<OrmNamedNativeQuery> namedNativeQueries = entityMappings().namedNativeQueries(); + ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("FOO", namedNativeQueries.next().getName()); assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("BAZ", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedNativeQueries().move(2, 0); - namedNativeQueries = entityMappings().namedNativeQueries(); + getOrmResource().getEntityMappings().getNamedNativeQueries().move(2, 0); + namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - ormResource().getEntityMappings().getNamedNativeQueries().move(0, 1); - namedNativeQueries = entityMappings().namedNativeQueries(); + getOrmResource().getEntityMappings().getNamedNativeQueries().move(0, 1); + namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - ormResource().getEntityMappings().getNamedNativeQueries().remove(1); - namedNativeQueries = entityMappings().namedNativeQueries(); + getOrmResource().getEntityMappings().getNamedNativeQueries().remove(1); + namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedNativeQueries().remove(1); - namedNativeQueries = entityMappings().namedNativeQueries(); + getOrmResource().getEntityMappings().getNamedNativeQueries().remove(1); + namedNativeQueries = getEntityMappings().namedNativeQueries(); assertEquals("BAZ", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); - ormResource().getEntityMappings().getNamedNativeQueries().remove(0); - assertFalse(entityMappings().namedNativeQueries().hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); + getOrmResource().getEntityMappings().getNamedNativeQueries().remove(0); + assertFalse(getEntityMappings().namedNativeQueries().hasNext()); + assertEquals(0, CollectionTools.size(getEntityMappings().getPersistenceUnit().allQueries())); } }
\ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java index 5ab76feb9a..5eeb020f6c 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java @@ -35,15 +35,15 @@ public class OrmAssociationOverrideTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next(); @@ -73,10 +73,10 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next(); @@ -97,10 +97,10 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase public void testAddSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next(); @@ -136,9 +136,9 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase } public void testRemoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next(); @@ -164,9 +164,9 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase } public void testMoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next(); @@ -202,9 +202,9 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase } public void testUpdateJoinColumns() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); OrmAssociationOverride ormAssociationOverride = ormEntity.specifiedAssociationOverrides().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java index f511d12f58..ace755f1c9 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAttributeOverrideTests.java @@ -33,15 +33,15 @@ public class OrmAttributeOverrideTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0); OrmAttributeOverride ormAttributeOverride = ormEntity.specifiedAttributeOverrides().next(); @@ -71,10 +71,10 @@ public class OrmAttributeOverrideTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0); OrmAttributeOverride ormAttributeOverride = ormEntity.specifiedAttributeOverrides().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java index 039e5b4eba..c8dbc46784 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmBasicMappingTests.java @@ -52,8 +52,8 @@ public class OrmBasicMappingTests 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 createTestEntityBasicMapping() throws Exception { @@ -83,10 +83,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertEquals("basicMapping", ormBasicMapping.getName()); assertEquals("basicMapping", basicResource.getName()); @@ -103,10 +103,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertEquals("basicMapping", ormBasicMapping.getName()); assertEquals("basicMapping", basicResource.getName()); @@ -123,10 +123,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedFetch()); assertNull(basicResource.getFetch()); @@ -147,10 +147,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testModifySpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedFetch()); assertNull(basicResource.getFetch()); @@ -171,10 +171,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedEnumerated() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedConverter()); assertNull(basicResource.getEnumerated()); @@ -195,10 +195,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testModifySpecifiedEnumerated() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedConverter()); assertNull(basicResource.getEnumerated()); @@ -220,10 +220,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedOptional() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedOptional()); assertNull(basicResource.getOptional()); @@ -244,10 +244,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testModifySpecifiedOptional() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedOptional()); assertNull(basicResource.getOptional()); @@ -268,10 +268,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedLob() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedConverter()); assertFalse(basicResource.isLob()); @@ -288,10 +288,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testModifySpecifiedLob() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedConverter()); assertFalse(basicResource.isLob()); @@ -308,10 +308,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testUpdateTemporal() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedConverter()); assertNull(basicResource.getTemporal()); @@ -336,10 +336,10 @@ public class OrmBasicMappingTests extends ContextModelTestCase } public void testModifyTemporal() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); - XmlBasic basicResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); + XmlBasic basicResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0); assertNull(ormBasicMapping.getSpecifiedConverter()); assertNull(basicResource.getTemporal()); @@ -371,7 +371,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMappingNoUnderylingJavaAttribute() throws Exception { createTestEntityBasicMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -419,7 +419,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase //@Enumerated(EnumType.STRING) public void testVirtualMappingMetadataCompleteFalse() throws Exception { createTestEntityBasicMapping(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -445,7 +445,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testVirtualMappingMetadataCompleteTrue() throws Exception { createTestEntityBasicMapping(); - 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); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -472,7 +472,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testSpecifiedMapping() throws Exception { createTestEntityBasicMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "id"); assertEquals(1, ormPersistentType.virtualAttributesSize()); @@ -518,7 +518,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToIdMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -540,7 +540,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToVersionMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -562,7 +562,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToTransientMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -583,7 +583,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToEmbeddedMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -604,7 +604,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToEmbeddedIdMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -625,7 +625,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToOneToOneMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -646,7 +646,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToOneToManyMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -667,7 +667,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToManyToOneMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); @@ -688,7 +688,7 @@ public class OrmBasicMappingTests extends ContextModelTestCase public void testBasicMorphToManyToManyMapping() throws Exception { createTestEntityBasicMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basic"); BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java index 88a74c4dd0..9ee89d8546 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmCascadeTests.java @@ -34,15 +34,15 @@ public class OrmCascadeTests 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); } public void testUpdateCascadeAll() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); assertEquals(false, cascade.isAll()); @@ -65,10 +65,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testModifyCascadeAll() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); @@ -87,10 +87,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testUpdateCascadePersist() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); assertEquals(false, cascade.isPersist()); @@ -113,10 +113,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testModifyCascadePersist() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); @@ -135,10 +135,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testUpdateCascadeMerge() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); assertEquals(false, cascade.isMerge()); @@ -161,10 +161,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testModifyCascadeMerge() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); @@ -183,10 +183,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testUpdateCascadeRemove() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); assertEquals(false, cascade.isRemove()); @@ -209,10 +209,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testModifyCascadeRemove() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); @@ -231,10 +231,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testUpdateCascadeRefresh() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); assertEquals(false, cascade.isRefresh()); @@ -257,10 +257,10 @@ public class OrmCascadeTests extends ContextModelTestCase } public void testModifyCascadeRefresh() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); Cascade cascade = ormOneToOneMapping.getCascade(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java index 5d5755c18f..266c716b9c 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java @@ -43,8 +43,8 @@ public class OrmColumnTests 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 { @@ -83,12 +83,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedName()); @@ -97,7 +97,7 @@ public class OrmColumnTests extends ContextModelTestCase //set name in the resource model, verify context model updated basic.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl()); basic.getColumn().setName("FOO"); - ormResource().save(null); + getOrmResource().save(null); assertEquals("FOO", ormColumn.getSpecifiedName()); assertEquals("FOO", basic.getColumn().getName()); @@ -116,12 +116,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedName()); @@ -139,12 +139,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getColumnDefinition()); @@ -171,12 +171,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifyColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getColumnDefinition()); @@ -194,12 +194,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedTable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedTable()); @@ -226,12 +226,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedTable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedTable()); @@ -249,12 +249,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedNullable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedNullable()); @@ -281,12 +281,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedNullable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedNullable()); @@ -304,12 +304,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedUpdatable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedUpdatable()); @@ -336,12 +336,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedUpdatable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedUpdatable()); @@ -359,12 +359,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedInsertable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedInsertable()); @@ -391,12 +391,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedInsertable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedInsertable()); @@ -414,12 +414,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedUnique() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedUnique()); @@ -446,12 +446,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedUnique() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedUnique()); @@ -469,12 +469,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedLength() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedLength()); @@ -501,12 +501,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedLength() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedLength()); @@ -524,12 +524,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedPrecision() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedLength()); @@ -556,12 +556,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedPrecision() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedLength()); @@ -579,12 +579,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedScale() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedLength()); @@ -611,12 +611,12 @@ public class OrmColumnTests extends ContextModelTestCase } public void testModifySpecifiedScale() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping"); OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping(); OrmColumn ormColumn = ormBasicMapping.getColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entityResource.getAttributes().getBasics().get(0); assertNull(ormColumn.getSpecifiedLength()); @@ -636,7 +636,7 @@ public class OrmColumnTests extends ContextModelTestCase public void testVirtualColumnDefaults() throws Exception { 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); ListIterator<OrmPersistentAttribute> attributes = ormPersistentType.virtualAttributes(); attributes.next(); @@ -693,7 +693,7 @@ public class OrmColumnTests extends ContextModelTestCase assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue()); assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals("name", ormColumn.getSpecifiedName()); assertEquals(TYPE_NAME, ormColumn.getSpecifiedTable()); @@ -719,7 +719,7 @@ public class OrmColumnTests extends ContextModelTestCase assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue()); //set metadata-complete false, orm.xml virtual column gets setting from java annotation - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("FOO", ormColumn.getSpecifiedName()); assertEquals("FOO_TABLE", ormColumn.getSpecifiedTable()); assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition()); @@ -735,7 +735,7 @@ public class OrmColumnTests extends ContextModelTestCase public void testNullColumnDefaults() throws Exception { 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); OrmPersistentAttribute namePersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "name"); OrmBasicMapping nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping(); @@ -779,7 +779,7 @@ public class OrmColumnTests extends ContextModelTestCase public void testVirtualColumnTable() throws Exception { 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); ListIterator<OrmPersistentAttribute> attributes = ormPersistentType.virtualAttributes(); attributes.next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java index 5ca9a0f180..5e289ba87f 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java @@ -38,8 +38,8 @@ public class OrmDiscriminatorColumnTests 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 { @@ -78,11 +78,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getSpecifiedName()); assertNull(entityResource.getDiscriminatorColumn()); @@ -108,11 +108,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getSpecifiedName()); assertNull(entityResource.getDiscriminatorColumn()); @@ -185,11 +185,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase // } public void testUpdateSpecifiedLength() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getSpecifiedLength()); assertNull(entityResource.getDiscriminatorColumn()); @@ -215,11 +215,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testModifySpecifiedLength() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getSpecifiedLength()); assertNull(entityResource.getDiscriminatorColumn()); @@ -236,11 +236,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getColumnDefinition()); assertNull(entityResource.getDiscriminatorColumn()); @@ -266,11 +266,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testModifySpecifiedColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getColumnDefinition()); assertNull(entityResource.getDiscriminatorColumn()); @@ -287,11 +287,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedDiscriminatorType() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getSpecifiedDiscriminatorType()); assertNull(entityResource.getDiscriminatorColumn()); @@ -317,11 +317,11 @@ public class OrmDiscriminatorColumnTests extends ContextModelTestCase } public void testModifySpecifiedDiscriminatorType() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormColumn.getSpecifiedDiscriminatorType()); assertNull(entityResource.getDiscriminatorColumn()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java index c1f8207037..cb8b4fcbe0 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddableTests.java @@ -38,14 +38,14 @@ public class OrmEmbeddableTests 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); } public void testUpdateClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertEquals("model.Foo", ormEmbeddable.getClass_()); assertEquals("model.Foo", embeddableResource.getClassName()); @@ -61,9 +61,9 @@ public class OrmEmbeddableTests extends ContextModelTestCase } public void testModifyClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertEquals("model.Foo", ormEmbeddable.getClass_()); assertEquals("model.Foo", embeddableResource.getClassName()); @@ -80,9 +80,9 @@ public class OrmEmbeddableTests extends ContextModelTestCase //TODO add tests for setting the className when the package is set on entity-mappings public void testUpdateSpecifiedAccess() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertNull(ormEmbeddable.getSpecifiedAccess()); assertNull(embeddableResource.getAccess()); @@ -98,9 +98,9 @@ public class OrmEmbeddableTests extends ContextModelTestCase } public void testModifySpecifiedAccess() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertNull(ormEmbeddable.getSpecifiedAccess()); assertNull(embeddableResource.getAccess()); @@ -121,9 +121,9 @@ public class OrmEmbeddableTests extends ContextModelTestCase //with xml-mapping-metadata-complete set public void testUpdateSpecifiedMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertNull(embeddableResource.getMetadataComplete()); //set metadata-complete in the resource model, verify context model updated @@ -142,9 +142,9 @@ public class OrmEmbeddableTests extends ContextModelTestCase } public void testModifySpecifiedMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertNull(embeddableResource.getMetadataComplete()); //set access in the context model, verify resource model modified @@ -163,54 +163,54 @@ public class OrmEmbeddableTests extends ContextModelTestCase } public void testUpdateDefaultMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertNull(ormEmbeddable.getSpecifiedMetadataComplete()); assertFalse(ormEmbeddable.isDefaultMetadataComplete()); assertNull(embeddableResource.getMetadataComplete()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(ormEmbeddable.isDefaultMetadataComplete()); assertNull(ormEmbeddable.getSpecifiedMetadataComplete()); assertNull(embeddableResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertNull(ormEmbeddable.getSpecifiedMetadataComplete()); assertFalse(ormEmbeddable.isDefaultMetadataComplete()); assertNull(embeddableResource.getMetadataComplete()); } public void testUpdateMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping(); - XmlEmbeddable embeddableResource = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddableResource = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertNull(ormEmbeddable.getSpecifiedMetadataComplete()); assertFalse(ormEmbeddable.isMetadataComplete()); assertNull(embeddableResource.getMetadataComplete()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(ormEmbeddable.isMetadataComplete()); assertNull(ormEmbeddable.getSpecifiedMetadataComplete()); assertNull(embeddableResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertFalse(ormEmbeddable.isMetadataComplete()); assertNull(ormEmbeddable.getSpecifiedMetadataComplete()); assertNull(embeddableResource.getMetadataComplete()); } public void testMakeEmbeddableEntity() throws Exception { - OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType embeddablePersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping(); embeddable.setSpecifiedAccess(AccessType.PROPERTY); embeddable.setSpecifiedMetadataComplete(Boolean.TRUE); embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("model.Foo", entity.getClassName()); assertEquals(Boolean.TRUE, entity.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess()); @@ -225,15 +225,15 @@ public class OrmEmbeddableTests extends ContextModelTestCase //test with 2 Embeddables, make the second one an Entity so it has to move to the front of the list public void testMakeEmbeddableEntity2() throws Exception { - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2"); - OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType embeddablePersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping(); embeddable.setSpecifiedAccess(AccessType.PROPERTY); embeddable.setSpecifiedMetadataComplete(Boolean.TRUE); embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("model.Foo", entity.getClassName()); assertEquals(Boolean.TRUE, entity.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess()); @@ -245,20 +245,20 @@ public class OrmEmbeddableTests extends ContextModelTestCase assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete()); assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess()); - ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes(); + ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().ormPersistentTypes(); assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); } public void testMakeEmbeddableMappedSuperclass() throws Exception { - OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType embeddablePersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping(); embeddable.setSpecifiedAccess(AccessType.PROPERTY); embeddable.setSpecifiedMetadataComplete(Boolean.TRUE); embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclass = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertEquals("model.Foo", mappedSuperclass.getClassName()); assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess()); @@ -271,15 +271,15 @@ public class OrmEmbeddableTests extends ContextModelTestCase //test with 2 Embeddables, make the second one a MappedSuperclass so it has to move to the front of the list public void testMakeEmbeddableMappedSuperclass2() throws Exception { - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2"); - OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType embeddablePersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping(); embeddable.setSpecifiedAccess(AccessType.PROPERTY); embeddable.setSpecifiedMetadataComplete(Boolean.TRUE); embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclass = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertEquals("model.Foo", mappedSuperclass.getClassName()); assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess()); @@ -289,7 +289,7 @@ public class OrmEmbeddableTests extends ContextModelTestCase assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete()); assertEquals(AccessType.PROPERTY, ormMappedSuperclass.getSpecifiedAccess()); - ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes(); + ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().ormPersistentTypes(); assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java index bb9a105277..3a763df567 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java @@ -56,8 +56,8 @@ public class OrmEmbeddedIdMappingTests 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 createTestEntityEmbeddedIdMapping() throws Exception { @@ -315,12 +315,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToIdMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -336,12 +336,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToVersionMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -357,12 +357,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToTransientMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -378,12 +378,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToBasicMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -399,12 +399,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToEmbeddedMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -423,12 +423,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToOneToOneMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -444,12 +444,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToOneToManyMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -465,12 +465,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToManyToOneMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -484,12 +484,12 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testEmbeddedIdMorphToManyToManyMapping() throws Exception { createTestEntityEmbeddedIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedId"); EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedIdMapping.isDefault()); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedIdMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -504,10 +504,10 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping(); - XmlEmbeddedId embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); assertEquals("embeddedMapping", ormEmbeddedMapping.getName()); assertEquals("embeddedMapping", embeddedResource.getName()); @@ -524,10 +524,10 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping(); - XmlEmbeddedId embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); assertEquals("embeddedMapping", ormEmbeddedMapping.getName()); assertEquals("embeddedMapping", embeddedResource.getName()); @@ -544,10 +544,10 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase } public void testMoveSpecifiedAttributeOverride() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping(); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); @@ -582,10 +582,10 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase } public void testUpdateAttributeOverrides() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping(); - XmlEmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); + XmlEmbeddedId embeddedIdResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); @@ -635,8 +635,8 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase createTestEntityEmbeddedIdMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(3, ormPersistentType.virtualAttributesSize()); @@ -653,8 +653,8 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase public void testVirtualAttributeOverrides() throws Exception { createTestEntityEmbeddedIdMapping(); createTestEmbeddableAddress(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType persistentType2 = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType2 = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); //embedded mapping is virtual, specified attribute overrides should exist OrmEmbeddedIdMapping embeddedIdMapping = (OrmEmbeddedIdMapping) persistentType.getAttributeNamed("address").getMapping(); @@ -737,8 +737,8 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase createTestEntityEmbeddedIdMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -776,8 +776,8 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase createTestEntityEmbeddedIdMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -825,8 +825,8 @@ public class OrmEmbeddedIdMappingTests extends ContextModelTestCase createTestEntityEmbeddedIdMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "address"); assertEquals(2, ormPersistentType.virtualAttributesSize()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java index 7083bc3b88..9777e9fdf0 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java @@ -55,8 +55,8 @@ public class OrmEmbeddedMappingTests 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 createTestEntityEmbeddedMapping() throws Exception { @@ -123,10 +123,10 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping(); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); assertEquals("embeddedMapping", ormEmbeddedMapping.getName()); assertEquals("embeddedMapping", embeddedResource.getName()); @@ -143,10 +143,10 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping(); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); assertEquals("embeddedMapping", ormEmbeddedMapping.getName()); assertEquals("embeddedMapping", embeddedResource.getName()); @@ -223,10 +223,10 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase // } public void testMoveSpecifiedAttributeOverride() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping(); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); @@ -261,10 +261,10 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase } public void testUpdateAttributeOverrides() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedMapping"); OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping(); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); @@ -314,8 +314,8 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase createTestEntityEmbeddedMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(3, ormPersistentType.virtualAttributesSize()); @@ -332,8 +332,8 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testVirtualAttributeOverrides() throws Exception { createTestEntityEmbeddedMapping(); createTestEmbeddableAddress(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType persistentType2 = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType2 = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); //embedded mapping is virtual, specified attribute overrides should exist OrmEmbeddedMapping embeddedMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping(); @@ -376,7 +376,7 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase //embedded mapping is specified, virtual attribute overrides should exist persistentType.getAttributeNamed("address").makeSpecified(); - ormResource().save(null); + getOrmResource().save(null); embeddedMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping(); assertEquals(4, embeddedMapping.attributeOverridesSize()); assertEquals(4, embeddedMapping.virtualAttributeOverridesSize()); @@ -416,8 +416,8 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase createTestEntityEmbeddedMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -455,8 +455,8 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase createTestEntityEmbeddedMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -503,8 +503,8 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase createTestEntityEmbeddedMapping(); createTestEmbeddableAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "address"); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -552,12 +552,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToIdMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -573,12 +573,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToVersionMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -594,12 +594,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToTransientMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -615,12 +615,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToBasicMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -636,12 +636,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToEmbeddedIdMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -660,12 +660,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToOneToOneMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -681,12 +681,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToOneToManyMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -702,12 +702,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToManyToOneMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); @@ -723,12 +723,12 @@ public class OrmEmbeddedMappingTests extends ContextModelTestCase public void testEmbeddedMorphToManyToManyMapping() throws Exception { createTestEntityEmbeddedMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embedded"); EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping(); assertFalse(embeddedMapping.isDefault()); - XmlEmbedded embeddedResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); + XmlEmbedded embeddedResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0); embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); AttributeOverride attributeOverride = embeddedMapping.specifiedAttributeOverrides().next(); attributeOverride.setName("override"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java index 2ec0ffca80..b0c676da56 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java @@ -58,8 +58,8 @@ public class OrmEntityTests 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 createTestEntityDefaultFieldAccess() throws Exception { @@ -180,9 +180,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedName()); assertNull(entityResource.getName()); @@ -198,9 +198,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedName()); assertNull(entityResource.getName()); @@ -218,9 +218,9 @@ public class OrmEntityTests extends ContextModelTestCase public void testUpdateDefaultName() throws Exception { createTestEntityFieldAccess(); - 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(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(TYPE_NAME, ormEntity.getDefaultName()); ormEntity.getJavaEntity().setSpecifiedName("Foo"); @@ -248,9 +248,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("Foo", ormEntity.getName()); //set class in the resource model, verify context model updated @@ -269,9 +269,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("model.Foo", ormEntity.getClass_()); assertEquals("model.Foo", entityResource.getClassName()); @@ -287,9 +287,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifyClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("model.Foo", ormEntity.getClass_()); assertEquals("model.Foo", entityResource.getClassName()); @@ -306,9 +306,9 @@ public class OrmEntityTests extends ContextModelTestCase //TODO add tests for setting the className when the package is set on entity-mappings public void testUpdateSpecifiedAccess() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedAccess()); assertNull(entityResource.getAccess()); @@ -324,9 +324,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifySpecifiedAccess() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedAccess()); assertNull(entityResource.getAccess()); @@ -342,26 +342,26 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateDefaultAccessFromPersistenceUnitDefaults() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedAccess()); assertNull(ormEntity.getDefaultAccess()); assertNull(entityResource.getAccess()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); assertNull(ormEntity.getSpecifiedAccess()); assertNull(entityResource.getAccess()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY); assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess()); assertNull(ormEntity.getSpecifiedAccess()); assertNull(entityResource.getAccess()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); assertNull(ormEntity.getSpecifiedAccess()); assertNull(ormEntity.getDefaultAccess()); assertNull(entityResource.getAccess()); @@ -370,29 +370,29 @@ public class OrmEntityTests extends ContextModelTestCase public void testUpdateDefaultAccessFromJava() throws Exception { createTestEntityDefaultFieldAccess(); - 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(); //java has no annotations, so defaultAccess in xml is null assertNull(ormEntity.getDefaultAccess()); - entityMappings().setSpecifiedAccess(AccessType.FIELD); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().setSpecifiedAccess(AccessType.FIELD); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); //entityMappings access wins over persistence-unit-defaults access assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); - entityMappings().setSpecifiedAccess(null); + getEntityMappings().setSpecifiedAccess(null); //persistence-unit-defaults access used now assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); assertNull(ormEntity.getDefaultAccess()); ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); //java has annotations on fields now, that should win in all cases assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); - entityMappings().setSpecifiedAccess(AccessType.PROPERTY); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); @@ -402,7 +402,7 @@ public class OrmEntityTests extends ContextModelTestCase public void testUpdateDefaultAccessFromJavaFieldAccess() throws Exception { createTestEntityFieldAccess(); - 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(); assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); @@ -412,20 +412,20 @@ public class OrmEntityTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertNull(ormEntity.getDefaultAccess()); ormEntity.setSpecifiedMetadataComplete(null); assertNull(ormEntity.getDefaultAccess()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals(AccessType.FIELD, ormEntity.getDefaultAccess()); } public void testUpdateDefaultAccessFromJavaPropertyAccess() throws Exception { createTestEntityPropertyAccess(); - 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(); assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess()); @@ -435,26 +435,26 @@ public class OrmEntityTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertNull(ormEntity.getDefaultAccess()); ormEntity.setSpecifiedMetadataComplete(null); assertNull(ormEntity.getDefaultAccess()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals(AccessType.PROPERTY, ormEntity.getDefaultAccess()); } public void testUpdateDefaultAccessNoUnderlyingJava() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); assertNull(ormEntity.getDefaultAccess()); } public void testUpdateSpecifiedMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertNull(entityResource.getMetadataComplete()); @@ -474,9 +474,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifySpecifiedMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertNull(entityResource.getMetadataComplete()); @@ -496,25 +496,25 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateDefaultMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertFalse(ormEntity.isDefaultMetadataComplete()); assertNull(entityResource.getMetadataComplete()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(ormEntity.isDefaultMetadataComplete()); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertNull(entityResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertFalse(ormEntity.isDefaultMetadataComplete()); assertNull(entityResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete()); assertTrue(ormEntity.isDefaultMetadataComplete()); @@ -522,20 +522,20 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertFalse(ormEntity.isMetadataComplete()); assertNull(entityResource.getMetadataComplete()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(ormEntity.isMetadataComplete()); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertNull(entityResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertFalse(ormEntity.isMetadataComplete()); assertNull(ormEntity.getSpecifiedMetadataComplete()); assertNull(entityResource.getMetadataComplete()); @@ -543,9 +543,9 @@ public class OrmEntityTests extends ContextModelTestCase public void testUpdateInheritanceStrategy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getInheritanceStrategy()); assertNull(entityResource.getInheritance()); @@ -560,7 +560,7 @@ public class OrmEntityTests extends ContextModelTestCase public void testUpdateDefaultInheritanceStrategyFromJava() throws Exception { createTestEntityDefaultFieldAccess(); - 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(); //no inheritance strategy specified in java so single-table is default assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy()); @@ -581,7 +581,7 @@ public class OrmEntityTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //this setting overrides the false meta-data complete found on ormEntity assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy()); } @@ -590,8 +590,8 @@ public class OrmEntityTests extends ContextModelTestCase createTestEntityDefaultFieldAccess(); createTestSubType(); - OrmPersistentType parentPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity parentXmlEntity = (OrmEntity) parentPersistentType.getMapping(); OrmEntity childXmlEntity = (OrmEntity) childPersistentType.getMapping(); @@ -612,15 +612,15 @@ public class OrmEntityTests extends ContextModelTestCase assertNull(parentXmlEntity.getSpecifiedInheritanceStrategy()); assertNull(childXmlEntity.getSpecifiedInheritanceStrategy()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy()); assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy()); } public void testUpdateSpecifiedInheritanceStrategy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedInheritanceStrategy()); assertNull(entityResource.getInheritance()); @@ -645,9 +645,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifySpecifiedInheritanceStrategy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedInheritanceStrategy()); assertNull(entityResource.getInheritance()); @@ -663,9 +663,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testAddSpecifiedSecondaryTable() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0); secondaryTable.setSpecifiedName("FOO"); @@ -697,14 +697,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testRemoveSpecifiedSecondaryTable() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getSecondaryTables().size()); ormEntity.removeSpecifiedSecondaryTable(0); @@ -721,14 +721,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMoveSpecifiedSecondaryTable() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR"); ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getSecondaryTables().size()); @@ -755,10 +755,10 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateSecondaryTables() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl()); entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl()); entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl()); @@ -806,8 +806,8 @@ public class OrmEntityTests extends ContextModelTestCase createTestEntityFieldAccess(); createTestSubType(); - OrmPersistentType parentPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity parentOrmEntity = (OrmEntity) parentPersistentType.getMapping(); OrmEntity childOrmEntity = (OrmEntity) childPersistentType.getMapping(); JavaEntity javaEntity = childOrmEntity.getJavaEntity(); @@ -879,7 +879,7 @@ public class OrmEntityTests extends ContextModelTestCase public void testAssociatedTables() throws Exception { createTestEntityFieldAccess(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity entity = (OrmEntity) persistentType.getMapping(); assertEquals(1, CollectionTools.size(entity.associatedTables())); @@ -900,7 +900,7 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMakeEntityEmbeddable() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity entity = (OrmEntity) entityPersistentType.getMapping(); entity.setSpecifiedAccess(AccessType.PROPERTY); entity.setSpecifiedDiscriminatorValue("DISC_VALUE"); @@ -910,7 +910,7 @@ public class OrmEntityTests extends ContextModelTestCase entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddable = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertEquals("model.Foo", embeddable.getClassName()); assertEquals(Boolean.TRUE, embeddable.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess()); @@ -923,8 +923,8 @@ public class OrmEntityTests extends ContextModelTestCase //TODO test that attribute mappings are not removed when changing type mapping. public void testMakeEntityEmbeddable2() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); OrmEntity entity = (OrmEntity) entityPersistentType.getMapping(); entity.setSpecifiedAccess(AccessType.PROPERTY); entity.setSpecifiedDiscriminatorValue("DISC_VALUE"); @@ -935,7 +935,7 @@ public class OrmEntityTests extends ContextModelTestCase entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddable = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertEquals("model.Foo", embeddable.getClassName()); assertEquals(Boolean.TRUE, embeddable.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess()); @@ -949,7 +949,7 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMakeEntityMappedSuperclass() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity entity = (OrmEntity) entityPersistentType.getMapping(); entity.setSpecifiedAccess(AccessType.PROPERTY); entity.setSpecifiedDiscriminatorValue("DISC_VALUE"); @@ -959,7 +959,7 @@ public class OrmEntityTests extends ContextModelTestCase entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclass = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertEquals("model.Foo", mappedSuperclass.getClassName()); assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess()); @@ -971,8 +971,8 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMakeEntityMappedSuperclass2() throws Exception { - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity entity = (OrmEntity) entityPersistentType.getMapping(); entity.setSpecifiedAccess(AccessType.PROPERTY); entity.setSpecifiedDiscriminatorValue("DISC_VALUE"); @@ -982,7 +982,7 @@ public class OrmEntityTests extends ContextModelTestCase entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY); - XmlMappedSuperclass mappedSuperclass = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclass = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertEquals("model.Foo", mappedSuperclass.getClassName()); assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess()); @@ -995,9 +995,9 @@ public class OrmEntityTests extends ContextModelTestCase public void testAddSequenceGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSequenceGenerator()); assertNull(entityResource.getSequenceGenerator()); @@ -1017,9 +1017,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testRemoveSequenceGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSequenceGenerator()); assertNull(entityResource.getSequenceGenerator()); @@ -1043,9 +1043,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateSequenceGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSequenceGenerator()); assertNull(entityResource.getSequenceGenerator()); @@ -1067,9 +1067,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testAddTableGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getTableGenerator()); assertNull(entityResource.getTableGenerator()); @@ -1089,9 +1089,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testRemoveTableGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getTableGenerator()); assertNull(entityResource.getTableGenerator()); @@ -1115,9 +1115,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateTableGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getTableGenerator()); assertNull(entityResource.getTableGenerator()); @@ -1139,9 +1139,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateDiscriminatorColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNotNull(ormEntity.getDiscriminatorColumn()); @@ -1162,9 +1162,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateDiscriminatorValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedDiscriminatorValue()); assertNull(entityResource.getDiscriminatorValue()); @@ -1181,9 +1181,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifyDiscriminatorValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getSpecifiedDiscriminatorValue()); assertNull(entityResource.getDiscriminatorValue()); @@ -1200,9 +1200,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); primaryKeyJoinColumn.setSpecifiedName("FOO"); @@ -1234,14 +1234,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size()); ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0); @@ -1258,14 +1258,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size()); @@ -1292,10 +1292,10 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdatePrimaryKeyJoinColumns() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl()); entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl()); entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl()); @@ -1343,8 +1343,8 @@ public class OrmEntityTests extends ContextModelTestCase createTestType(); createTestSubTypeUnmapped(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY); persistentType.getAttributeNamed("id").makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); @@ -1395,8 +1395,8 @@ public class OrmEntityTests extends ContextModelTestCase createTestEntityFieldAccess(); createTestSubType(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED); @@ -1498,10 +1498,10 @@ public class OrmEntityTests extends ContextModelTestCase // } public void testMoveSpecifiedAttributeOverride() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); @@ -1536,10 +1536,10 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateAttributeOverrides() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl()); @@ -1586,8 +1586,8 @@ public class OrmEntityTests extends ContextModelTestCase public void testVirtualAttributeOverrides() throws Exception { createTestMappedSuperclass(); createTestSubType(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); - OrmPersistentType persistentType2 = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); + OrmPersistentType persistentType2 = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity entity = (OrmEntity) persistentType.getMapping(); @@ -1652,8 +1652,8 @@ public class OrmEntityTests extends ContextModelTestCase public void testVirtualAttributeOverridesNoJavaEntity() throws Exception { createTestMappedSuperclass(); createTestSubType(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity entity = (OrmEntity) persistentType.getMapping(); @@ -1672,8 +1672,8 @@ public class OrmEntityTests extends ContextModelTestCase public void testAttributeOverrideColumnDefaults() throws Exception { createTestMappedSuperclass(); createTestSubType(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity entity = (OrmEntity) persistentType.getMapping(); @@ -1757,10 +1757,10 @@ public class OrmEntityTests extends ContextModelTestCase // } public void testMoveSpecifiedAssociationOverride() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); @@ -1795,10 +1795,10 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateAssociationOverrides() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverrideImpl()); @@ -1844,9 +1844,9 @@ public class OrmEntityTests extends ContextModelTestCase public void testAddNamedQuery() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); OrmNamedQuery namedQuery = ormEntity.addNamedQuery(0); namedQuery.setName("FOO"); @@ -1878,14 +1878,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testRemoveNamedQuery() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addNamedQuery(0).setName("FOO"); ormEntity.addNamedQuery(1).setName("BAR"); ormEntity.addNamedQuery(2).setName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getNamedQueries().size()); ormEntity.removeNamedQuery(0); @@ -1902,14 +1902,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMoveNamedQuery() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addNamedQuery(0).setName("FOO"); ormEntity.addNamedQuery(1).setName("BAR"); ormEntity.addNamedQuery(2).setName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getNamedQueries().size()); @@ -1936,12 +1936,12 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateNamedQueries() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); @@ -1989,9 +1989,9 @@ public class OrmEntityTests extends ContextModelTestCase } public void testAddNamedNativeQuery() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); OrmNamedNativeQuery namedNativeQuery = ormEntity.addNamedNativeQuery(0); namedNativeQuery.setName("FOO"); @@ -2023,14 +2023,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testRemoveNamedNativeQuery() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addNamedNativeQuery(0).setName("FOO"); ormEntity.addNamedNativeQuery(1).setName("BAR"); ormEntity.addNamedNativeQuery(2).setName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getNamedNativeQueries().size()); ormEntity.removeNamedNativeQuery(0); @@ -2047,14 +2047,14 @@ public class OrmEntityTests extends ContextModelTestCase } public void testMoveNamedNativeQuery() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); ormEntity.addNamedNativeQuery(0).setName("FOO"); ormEntity.addNamedNativeQuery(1).setName("BAR"); ormEntity.addNamedNativeQuery(2).setName("BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals(3, entityResource.getNamedNativeQueries().size()); @@ -2081,12 +2081,12 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateNamedNativeQueries() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); @@ -2133,10 +2133,10 @@ public class OrmEntityTests extends ContextModelTestCase } public void testUpdateIdClass() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getIdClass()); assertNull(entityResource.getIdClass()); @@ -2165,10 +2165,10 @@ public class OrmEntityTests extends ContextModelTestCase } public void testModifyIdClass() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormEntity.getIdClass()); assertNull(entityResource.getIdClass()); @@ -2186,8 +2186,8 @@ public class OrmEntityTests extends ContextModelTestCase public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception { createTestMappedSuperclass(); createTestSubType(); - OrmPersistentType parentPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity childXmlEntity = (OrmEntity) childPersistentType.getMapping(); assertNull(childXmlEntity.getPrimaryKeyColumnName()); @@ -2210,14 +2210,14 @@ public class OrmEntityTests extends ContextModelTestCase public void testDiscriminatorValueIsAllowedConcreteClass() throws Exception { createTestType(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity entity = (OrmEntity) persistentType.getMapping(); assertTrue(entity.isDiscriminatorValueAllowed()); } public void testDiscriminatorValueIsAllowedAbstractClass() throws Exception { createTestAbstractType(); - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity entity = (OrmEntity) persistentType.getMapping(); assertFalse(entity.isDiscriminatorValueAllowed()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java index c1d0ccada3..3029a34de6 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmGeneratedValueTests.java @@ -40,8 +40,8 @@ public class OrmGeneratedValueTests 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 { @@ -80,11 +80,11 @@ public class OrmGeneratedValueTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue(); //set generator in the resource model, verify context model updated @@ -99,11 +99,11 @@ public class OrmGeneratedValueTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue(); //set name in the context model, verify resource model modified @@ -119,7 +119,7 @@ public class OrmGeneratedValueTests extends ContextModelTestCase public void testDefaultsFromJava() throws Exception { 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); OrmPersistentAttribute ormIdAttribute = ormPersistentType.virtualAttributes().next(); IdMapping ormIdMapping = (IdMapping) ormIdAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java index 83534425bc..a1b8fad107 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java @@ -56,8 +56,8 @@ public class OrmIdMappingTests 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 createTestEntityIdMapping() throws Exception { @@ -89,10 +89,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertEquals("idMapping", ormIdMapping.getName()); assertEquals("idMapping", idResource.getName()); @@ -109,10 +109,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertEquals("idMapping", ormIdMapping.getName()); assertEquals("idMapping", idResource.getName()); @@ -129,10 +129,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testUpdateTemporal() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getSpecifiedConverter()); assertNull(idResource.getTemporal()); @@ -157,10 +157,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testModifyTemporal() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getSpecifiedConverter()); assertNull(idResource.getTemporal()); @@ -190,10 +190,10 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testAddSequenceGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getSequenceGenerator()); assertNull(idResource.getSequenceGenerator()); @@ -213,10 +213,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testRemoveSequenceGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getSequenceGenerator()); assertNull(idResource.getSequenceGenerator()); @@ -240,10 +240,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testUpdateSequenceGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getSequenceGenerator()); assertNull(idResource.getSequenceGenerator()); @@ -264,10 +264,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testAddTableGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getTableGenerator()); assertNull(idResource.getTableGenerator()); @@ -287,10 +287,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testRemoveTableGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getTableGenerator()); assertNull(idResource.getTableGenerator()); @@ -314,10 +314,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testUpdateTableGenerator() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getTableGenerator()); assertNull(idResource.getTableGenerator()); @@ -338,10 +338,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testAddGeneratedValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getGeneratedValue()); assertNull(idResource.getGeneratedValue()); @@ -361,10 +361,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testRemoveGeneratedValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getGeneratedValue()); assertNull(idResource.getGeneratedValue()); @@ -388,10 +388,10 @@ public class OrmIdMappingTests extends ContextModelTestCase } public void testUpdateGeneratedValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idMapping"); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping(); - XmlId idResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); + XmlId idResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getIds().get(0); assertNull(ormIdMapping.getGeneratedValue()); assertNull(idResource.getGeneratedValue()); @@ -410,7 +410,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMappingNoUnderylingJavaAttribute() throws Exception { createTestEntityIdMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -457,7 +457,7 @@ public class OrmIdMappingTests extends ContextModelTestCase //@Enumerated(EnumType.STRING) public void testVirtualMappingMetadataCompleteFalse() throws Exception { createTestEntityIdMapping(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -499,7 +499,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testVirtualMappingMetadataCompleteTrue() throws Exception { createTestEntityIdMapping(); - 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); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -532,7 +532,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testSpecifiedMapping() throws Exception { createTestEntityIdMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); assertEquals(1, ormPersistentType.virtualAttributesSize()); @@ -576,7 +576,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToBasicMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -596,7 +596,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToVersionMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -616,7 +616,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToTransientMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -633,7 +633,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToEmbeddedMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -652,7 +652,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToEmbeddedIdMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -669,7 +669,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToOneToOneMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -688,7 +688,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToOneToManyMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -707,7 +707,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToManyToOneMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); @@ -726,7 +726,7 @@ public class OrmIdMappingTests extends ContextModelTestCase public void testIdMorphToManyToManyMapping() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "id"); IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java index 24a19dba28..8d17a15c99 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java @@ -35,15 +35,15 @@ public class OrmJoinColumnTests 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); } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -73,10 +73,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -98,10 +98,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedReferencedColumnName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -131,10 +131,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedReferencedColumnName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -156,10 +156,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -189,10 +189,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -214,10 +214,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedTable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -247,10 +247,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedTable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -272,10 +272,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedNullable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -305,10 +305,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedNullable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -330,10 +330,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedUpdatable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -363,10 +363,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedUpdatable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -388,10 +388,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedInsertable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -421,10 +421,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedInsertable() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -446,10 +446,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedUnique() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); @@ -479,10 +479,10 @@ public class OrmJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedUnique() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java index b4a1da69d8..e77d521e0d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java @@ -49,8 +49,8 @@ public class OrmJoinTableTests 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 createTestEntityWithValidManyToMany() throws Exception { @@ -98,10 +98,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -130,10 +130,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -154,7 +154,7 @@ public class OrmJoinTableTests extends ContextModelTestCase public void testVirtualJoinTable() throws Exception { createTestEntityWithValidManyToMany(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -164,7 +164,7 @@ public class OrmJoinTableTests extends ContextModelTestCase assertEquals(null, ormJoinTable.getSpecifiedName()); createTargetEntity(); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project"); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project"); assertEquals(TYPE_NAME + "_Project", ormJoinTable.getSpecifiedName()); assertNull(ormJoinTable.getSpecifiedCatalog()); @@ -208,7 +208,7 @@ public class OrmJoinTableTests extends ContextModelTestCase public void testUpdateDefaultNameFromJavaTable() throws Exception { createTestEntityWithValidManyToMany(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "projects"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -217,7 +217,7 @@ public class OrmJoinTableTests extends ContextModelTestCase assertEquals(null, ormJoinTable.getDefaultName()); createTargetEntity(); - OrmPersistentType targetPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project"); + OrmPersistentType targetPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project"); assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName()); @@ -235,12 +235,12 @@ public class OrmJoinTableTests extends ContextModelTestCase //set metadata-complete to true, will ignore java annotation settings - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); //remove m-m mapping from the orm.xml file ormPersistentAttribute.makeVirtual(); //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null); @@ -262,10 +262,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUpdateSpecifiedSchema() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -380,10 +380,10 @@ public class OrmJoinTableTests extends ContextModelTestCase // } public void testModifySpecifiedSchema() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -402,10 +402,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUpdateSpecifiedCatalog() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -433,10 +433,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testModifySpecifiedCatalog() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -565,10 +565,10 @@ public class OrmJoinTableTests extends ContextModelTestCase public void testAddSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -603,10 +603,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testRemoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -631,10 +631,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testMoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -669,10 +669,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUpdateInverseJoinColumns() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -722,10 +722,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testAddSpecifiedInverseJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -760,10 +760,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testRemoveSpecifiedInverseJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -788,10 +788,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testMoveSpecifiedInverseJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); @@ -826,10 +826,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUpdateJoinColumns() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -880,10 +880,10 @@ public class OrmJoinTableTests extends ContextModelTestCase public void testUniqueConstraints() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -908,10 +908,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUniqueConstraintsSize() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -931,10 +931,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testAddUniqueConstraint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -953,10 +953,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testAddUniqueConstraint2() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -975,10 +975,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testRemoveUniqueConstraint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -1021,10 +1021,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testMoveUniqueConstraint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -1062,10 +1062,10 @@ public class OrmJoinTableTests extends ContextModelTestCase } public void testUpdateUniqueConstraints() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl()); @@ -1124,7 +1124,7 @@ public class OrmJoinTableTests extends ContextModelTestCase public void testUniqueConstraintsFromJava() throws Exception { createTestEntityWithValidManyToMany(); - 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); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.attributes().next().getMapping(); OrmJoinTable ormJoinTable = ormManyToManyMapping.getJoinTable(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java index 6507b43b0f..220820c219 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java @@ -46,15 +46,15 @@ public class OrmManyToManyMappingTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertEquals("manyToManyMapping", ormManyToManyMapping.getName()); assertEquals("manyToManyMapping", manyToMany.getName()); @@ -71,10 +71,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertEquals("manyToManyMapping", ormManyToManyMapping.getName()); assertEquals("manyToManyMapping", manyToMany.getName()); @@ -91,10 +91,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testUpdateTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getSpecifiedTargetEntity()); assertNull(manyToMany.getTargetEntity()); @@ -111,10 +111,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testModifyTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getSpecifiedTargetEntity()); assertNull(manyToMany.getTargetEntity()); @@ -131,10 +131,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToManyResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getSpecifiedFetch()); assertNull(manyToManyResource.getFetch()); @@ -155,10 +155,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testModifySpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToManyResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getSpecifiedFetch()); assertNull(manyToManyResource.getFetch()); @@ -179,10 +179,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testUpdateMappedBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getMappedBy()); assertNull(manyToMany.getMappedBy()); @@ -199,10 +199,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testModifyMappedBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getMappedBy()); assertNull(manyToMany.getMappedBy()); @@ -219,10 +219,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testUpdateMapKey() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getMapKey()); assertNull(manyToMany.getMapKey()); @@ -249,10 +249,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testModifyMapKey() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getMapKey()); assertNull(manyToMany.getMapKey()); @@ -269,10 +269,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testUpdateOrderBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getOrderBy()); assertNull(manyToMany.getOrderBy()); @@ -289,10 +289,10 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testModifyOrderBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - XmlManyToMany manyToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); + XmlManyToMany manyToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(ormManyToManyMapping.getOrderBy()); assertNull(manyToMany.getOrderBy()); @@ -309,7 +309,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testIsNoOrdering() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -323,7 +323,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testSetNoOrdering() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -346,7 +346,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase // } public void testIsCustomOrdering() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -360,7 +360,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToIdMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -387,7 +387,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToVersionMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -414,7 +414,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToTransientMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -441,7 +441,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToEmbeddedMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -468,7 +468,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToEmbeddedIdMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -495,7 +495,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToOneToOneMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -535,7 +535,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToOneToManyMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -581,7 +581,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToManyToOneMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); @@ -620,7 +620,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase } public void testManyToManyMorphToBasicMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToMany"); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java index d3008b6e88..1679935b70 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java @@ -40,8 +40,8 @@ public class OrmManyToOneMappingTests 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 createTestEntityManyToOneMapping() throws Exception { @@ -103,10 +103,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertEquals("manyToOneMapping", ormManyToOneMapping.getName()); assertEquals("manyToOneMapping", manyToOne.getName()); @@ -123,10 +123,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertEquals("manyToOneMapping", ormManyToOneMapping.getName()); assertEquals("manyToOneMapping", manyToOne.getName()); @@ -143,10 +143,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testUpdateTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertNull(ormManyToOneMapping.getSpecifiedTargetEntity()); assertNull(manyToOne.getTargetEntity()); @@ -163,10 +163,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testModifyTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertNull(ormManyToOneMapping.getSpecifiedTargetEntity()); assertNull(manyToOne.getTargetEntity()); @@ -183,10 +183,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertNull(ormManyToOneMapping.getSpecifiedFetch()); assertNull(manyToOneResource.getFetch()); @@ -207,10 +207,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testModifySpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertNull(ormManyToOneMapping.getSpecifiedFetch()); assertNull(manyToOneResource.getFetch()); @@ -231,10 +231,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedOptional() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertNull(ormManyToOneMapping.getSpecifiedOptional()); assertNull(manyToOneResource.getOptional()); @@ -255,10 +255,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testModifySpecifiedOptional() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); assertNull(ormManyToOneMapping.getSpecifiedOptional()); assertNull(manyToOneResource.getOptional()); @@ -279,10 +279,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testAddSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); OrmJoinColumn joinColumn = ormManyToOneMapping.addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("FOO"); @@ -314,10 +314,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testRemoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); ormManyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); ormManyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -339,10 +339,10 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase } public void testMoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - XmlManyToOne manyToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); + XmlManyToOne manyToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); ormManyToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); ormManyToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -378,8 +378,8 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase createTestEntityManyToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(3, ormPersistentType.virtualAttributesSize()); @@ -413,8 +413,8 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase createTestEntityManyToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -446,8 +446,8 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase createTestEntityManyToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -488,8 +488,8 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase createTestEntityManyToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address"); assertEquals(2, ormPersistentType.virtualAttributesSize()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java index 176aa0c4b3..782674ef9f 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmMappedSuperclassTests.java @@ -38,14 +38,14 @@ public class OrmMappedSuperclassTests 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); } public void testUpdateClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertEquals("model.Foo", ormMappedSuperclass.getClass_()); assertEquals("model.Foo", mappedSuperclassResource.getClassName()); @@ -61,9 +61,9 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase } public void testModifyClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertEquals("model.Foo", ormMappedSuperclass.getClass_()); assertEquals("model.Foo", mappedSuperclassResource.getClassName()); @@ -80,9 +80,9 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase //TODO add tests for setting the className when the package is set on entity-mappings public void testUpdateSpecifiedAccess() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedAccess()); assertNull(mappedSuperclassResource.getAccess()); @@ -98,9 +98,9 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase } public void testModifySpecifiedAccess() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedAccess()); assertNull(mappedSuperclassResource.getAccess()); @@ -121,9 +121,9 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase //with xml-mapping-metadata-complete set public void testUpdateSpecifiedMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); @@ -143,9 +143,9 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase } public void testModifySpecifiedMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); //set access in the context model, verify resource model modified @@ -164,42 +164,42 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase } public void testUpdateDefaultMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertFalse(ormMappedSuperclass.isDefaultMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(ormMappedSuperclass.isDefaultMetadataComplete()); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertFalse(ormMappedSuperclass.isDefaultMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); } public void testUpdateMetadataComplete() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertFalse(ormMappedSuperclass.isMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(ormMappedSuperclass.isMetadataComplete()); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertFalse(ormMappedSuperclass.isMetadataComplete()); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(mappedSuperclassResource.getMetadataComplete()); @@ -207,14 +207,14 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase public void testMakeMappedSuperclassEntity() throws Exception { - OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping(); mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY); mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE); mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("model.Foo", entity.getClassName()); assertEquals(Boolean.TRUE, entity.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess()); @@ -229,15 +229,15 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase //test with 2 MappedSuperclasses, make the first one an Entity so it has to move to the end of the list public void testMakeMappedSuperclassEntity2() throws Exception { - OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2"); OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping(); mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY); mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE); mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("model.Foo", entity.getClassName()); assertEquals(Boolean.TRUE, entity.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, entity.getAccess()); @@ -249,20 +249,20 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete()); assertEquals(AccessType.PROPERTY, ormEntity.getSpecifiedAccess()); - ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes(); + ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().ormPersistentTypes(); assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); } public void testMakeMappedSuperclassEmbeddable() throws Exception { - OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping(); mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY); mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE); mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddable = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertEquals("model.Foo", embeddable.getClassName()); assertEquals(Boolean.TRUE, embeddable.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess()); @@ -274,15 +274,15 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase } //test with 2 MappedSuperclasses, make the first one an Embeddable so it has to move to the end of the list public void testMakeMappedSuperclassEmbeddable2() throws Exception { - OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); - entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2"); OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping(); mappedSuperclass.setSpecifiedAccess(AccessType.PROPERTY); mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE); mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - XmlEmbeddable embeddable = ormResource().getEntityMappings().getEmbeddables().get(0); + XmlEmbeddable embeddable = getOrmResource().getEntityMappings().getEmbeddables().get(0); assertEquals("model.Foo", embeddable.getClassName()); assertEquals(Boolean.TRUE, embeddable.getMetadataComplete()); assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess()); @@ -292,15 +292,15 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete()); assertEquals(AccessType.PROPERTY, ormEmbeddable.getSpecifiedAccess()); - ListIterator<OrmPersistentType> persistentTypes = entityMappings().ormPersistentTypes(); + ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().ormPersistentTypes(); assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey()); } public void testUpdateIdClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(ormMappedSuperclass.getIdClass()); assertNull(mappedSuperclassResource.getIdClass()); @@ -329,9 +329,9 @@ public class OrmMappedSuperclassTests extends ContextModelTestCase } public void testModifyIdClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo"); OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping(); - XmlMappedSuperclass mappedSuperclassResource = ormResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); + XmlMappedSuperclass mappedSuperclassResource = getOrmResource().getEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete()); assertNull(ormMappedSuperclass.getIdClass()); assertNull(mappedSuperclassResource.getIdClass()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java index 84b6800528..f6c017ba62 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java @@ -35,16 +35,16 @@ public class OrmNamedNativeQueryTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertNull(ormNamedNativeQuery.getName()); assertNull(namedNativeQueryResource.getName()); @@ -61,11 +61,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertNull(ormNamedNativeQuery.getName()); assertNull(namedNativeQueryResource.getName()); @@ -82,11 +82,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testUpdateQuery() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertNull(ormNamedNativeQuery.getQuery()); assertNull(namedNativeQueryResource.getQuery()); @@ -103,11 +103,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testModifyQuery() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertNull(ormNamedNativeQuery.getQuery()); assertNull(namedNativeQueryResource.getQuery()); @@ -124,11 +124,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testAddHint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); OrmQueryHint queryHint = ormNamedNativeQuery.addHint(0); queryHint.setName("FOO"); @@ -160,11 +160,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testRemoveHint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); ormNamedNativeQuery.addHint(0).setName("FOO"); ormNamedNativeQuery.addHint(1).setName("BAR"); @@ -186,11 +186,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testMoveHint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); ormNamedNativeQuery.addHint(0).setName("FOO"); ormNamedNativeQuery.addHint(1).setName("BAR"); @@ -222,11 +222,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testUpdateHints() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint()); namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint()); @@ -273,11 +273,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase public void testUpdateResultSetMapping() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertEquals(null, namedNativeQueryResource.getResultSetMapping()); assertEquals(null, ormNamedNativeQuery.getResultSetMapping()); @@ -294,11 +294,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testModifyResultSetMapping() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertEquals(null, namedNativeQueryResource.getResultSetMapping()); assertEquals(null, ormNamedNativeQuery.getResultSetMapping()); @@ -315,11 +315,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testUpdateResultClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertEquals(null, namedNativeQueryResource.getResultClass()); assertEquals(null, ormNamedNativeQuery.getResultClass()); @@ -336,11 +336,11 @@ public class OrmNamedNativeQueryTests extends ContextModelTestCase } public void testModifyResultClass() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.addNamedNativeQuery(0); - XmlNamedNativeQuery namedNativeQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); + XmlNamedNativeQuery namedNativeQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0); assertEquals(null, namedNativeQueryResource.getResultClass()); assertEquals(null, ormNamedNativeQuery.getResultClass()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java index 6825936f29..1cb6021921 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmNamedQueryTests.java @@ -35,16 +35,16 @@ public class OrmNamedQueryTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); assertNull(ormNamedQuery.getName()); assertNull(namedQueryResource.getName()); @@ -61,11 +61,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); assertNull(ormNamedQuery.getName()); assertNull(namedQueryResource.getName()); @@ -82,11 +82,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testUpdateQuery() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); assertNull(ormNamedQuery.getQuery()); assertNull(namedQueryResource.getQuery()); @@ -103,11 +103,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testModifyQuery() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); assertNull(ormNamedQuery.getQuery()); assertNull(namedQueryResource.getQuery()); @@ -124,11 +124,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testAddHint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); OrmQueryHint queryHint = ormNamedQuery.addHint(0); queryHint.setName("FOO"); @@ -160,11 +160,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testRemoveHint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); ormNamedQuery.addHint(0).setName("FOO"); ormNamedQuery.addHint(1).setName("BAR"); @@ -186,11 +186,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testMoveHint() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); ormNamedQuery.addHint(0).setName("FOO"); ormNamedQuery.addHint(1).setName("BAR"); @@ -222,11 +222,11 @@ public class OrmNamedQueryTests extends ContextModelTestCase } public void testUpdateHints() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmNamedQuery ormNamedQuery = ormEntity.addNamedQuery(0); - XmlNamedQuery namedQueryResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); + XmlNamedQuery namedQueryResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0); namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint()); namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java index 22225dfef0..466e979a5c 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java @@ -46,15 +46,15 @@ public class OrmOneToManyMappingTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertEquals("oneToManyMapping", ormOneToManyMapping.getName()); assertEquals("oneToManyMapping", oneToMany.getName()); @@ -71,10 +71,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertEquals("oneToManyMapping", ormOneToManyMapping.getName()); assertEquals("oneToManyMapping", oneToMany.getName()); @@ -91,10 +91,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testUpdateTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getSpecifiedTargetEntity()); assertNull(oneToMany.getTargetEntity()); @@ -111,10 +111,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testModifyTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getSpecifiedTargetEntity()); assertNull(oneToMany.getTargetEntity()); @@ -131,10 +131,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToManyResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getSpecifiedFetch()); assertNull(oneToManyResource.getFetch()); @@ -155,10 +155,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testModifySpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToManyResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToManyResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getSpecifiedFetch()); assertNull(oneToManyResource.getFetch()); @@ -179,10 +179,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testUpdateMappedBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getMappedBy()); assertNull(oneToMany.getMappedBy()); @@ -199,10 +199,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testModifyMappedBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getMappedBy()); assertNull(oneToMany.getMappedBy()); @@ -220,10 +220,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase public void testUpdateMapKey() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getMapKey()); assertNull(oneToMany.getMapKey()); @@ -250,10 +250,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testModifyMapKey() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getMapKey()); assertNull(oneToMany.getMapKey()); @@ -270,10 +270,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testUpdateOrderBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getOrderBy()); assertNull(oneToMany.getOrderBy()); @@ -290,10 +290,10 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testModifyOrderBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - XmlOneToMany oneToMany = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); + XmlOneToMany oneToMany = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(ormOneToManyMapping.getOrderBy()); assertNull(oneToMany.getOrderBy()); @@ -310,7 +310,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testIsNoOrdering() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); @@ -324,7 +324,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testSetNoOrdering() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); @@ -347,7 +347,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase // } public void testIsCustomOrdering() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); @@ -361,7 +361,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToIdMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -388,7 +388,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToVersionMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -415,7 +415,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToTransientMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -442,7 +442,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToEmbeddedMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -469,7 +469,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToEmbeddedIdMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -496,7 +496,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToOneToOneMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -536,7 +536,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToManyToManyMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -582,7 +582,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToManyToOneMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); @@ -621,7 +621,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase } public void testOneToManyMorphToBasicMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToMany"); OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java index 85261282c8..c868c36d01 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java @@ -52,8 +52,8 @@ public class OrmOneToOneMappingTests 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 createTestEntityOneToOneMapping() throws Exception { @@ -115,10 +115,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertEquals("oneToOneMapping", ormOneToOneMapping.getName()); assertEquals("oneToOneMapping", oneToOne.getName()); @@ -135,10 +135,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertEquals("oneToOneMapping", ormOneToOneMapping.getName()); assertEquals("oneToOneMapping", oneToOne.getName()); @@ -155,10 +155,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getSpecifiedTargetEntity()); assertNull(oneToOne.getTargetEntity()); @@ -175,10 +175,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testModifySpecifiedTargetEntity() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getSpecifiedTargetEntity()); assertNull(oneToOne.getTargetEntity()); @@ -195,10 +195,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testUpdateSpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getSpecifiedFetch()); assertNull(oneToOneResource.getFetch()); @@ -219,10 +219,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testModifySpecifiedFetch() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getSpecifiedFetch()); assertNull(oneToOneResource.getFetch()); @@ -243,10 +243,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testUpdateMappedBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getMappedBy()); assertNull(oneToOne.getMappedBy()); @@ -263,10 +263,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testModifyMappedBy() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOne = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOne = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getMappedBy()); assertNull(oneToOne.getMappedBy()); @@ -284,10 +284,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase public void testUpdateSpecifiedOptional() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getSpecifiedOptional()); assertNull(oneToOneResource.getOptional()); @@ -308,10 +308,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testModifySpecifiedOptional() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(ormOneToOneMapping.getSpecifiedOptional()); assertNull(oneToOneResource.getOptional()); @@ -332,10 +332,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testAddSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); OrmJoinColumn joinColumn = ormOneToOneMapping.addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("FOO"); @@ -367,10 +367,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testRemoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); ormOneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); ormOneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -392,10 +392,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testMoveSpecifiedJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); ormOneToOneMapping.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); ormOneToOneMapping.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -430,8 +430,8 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase createTestEntityOneToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(3, ormPersistentType.virtualAttributesSize()); @@ -466,8 +466,8 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase createTestEntityOneToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -500,8 +500,8 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase createTestEntityOneToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(3, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -542,8 +542,8 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase createTestEntityOneToOneMapping(); createTestTargetEntityAddress(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address"); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address"); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -593,7 +593,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase public void testOneToOneMorphToIdMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -619,7 +619,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToVersionMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -645,7 +645,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToTransientMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -671,7 +671,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToEmbeddedMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -697,7 +697,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToEmbeddedIdMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -723,7 +723,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToManyToManyMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -757,7 +757,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToOneToManyMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -791,7 +791,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToManyToOneMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -828,7 +828,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testOneToOneMorphToBasicMapping() throws Exception { - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOne"); OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping(); @@ -859,10 +859,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase public void testAddPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); OrmPrimaryKeyJoinColumn joinColumn = ormOneToOneMapping.addPrimaryKeyJoinColumn(0); joinColumn.setSpecifiedName("FOO"); @@ -894,10 +894,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testRemovePrimaryKeyJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); ormOneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); ormOneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); @@ -919,10 +919,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase } public void testMovePrimaryKeyJoinColumn() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - XmlOneToOne oneToOneResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); + XmlOneToOne oneToOneResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); ormOneToOneMapping.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); ormOneToOneMapping.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java index aaefccf921..3b1f35551a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentAttributeTests.java @@ -38,8 +38,8 @@ public class OrmPersistentAttributeTests 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 createTestTypeNullAttributeMapping() throws Exception { @@ -92,7 +92,7 @@ public class OrmPersistentAttributeTests extends ContextModelTestCase public void testMakeSpecified() throws Exception { createTestType(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -124,7 +124,7 @@ public class OrmPersistentAttributeTests extends ContextModelTestCase public void testMakeSpecifiedMappingKey() throws Exception { createTestTypeNullAttributeMapping(); - 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); assertEquals(3, ormPersistentType.virtualAttributesSize()); @@ -162,7 +162,7 @@ public class OrmPersistentAttributeTests extends ContextModelTestCase public void testMakeVirtual() throws Exception { createTestType(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -193,7 +193,7 @@ public class OrmPersistentAttributeTests extends ContextModelTestCase public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception { createTestType(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -217,7 +217,7 @@ public class OrmPersistentAttributeTests extends ContextModelTestCase public void testVirtualMappingTypeWhenMetadataComplete() throws Exception { createTestEntityIdMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); assertEquals("id", ormPersistentAttribute.getName()); @@ -235,7 +235,7 @@ public class OrmPersistentAttributeTests extends ContextModelTestCase public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception { createTestEntityOneToOneMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); assertEquals("address", ormPersistentAttribute.getName()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java index 116390af5b..e753b63f60 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPersistentTypeTests.java @@ -49,8 +49,8 @@ public class OrmPersistentTypeTests 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); } // public void testUpdateXmlTypeMapping() throws Exception { @@ -95,40 +95,40 @@ public class OrmPersistentTypeTests extends ContextModelTestCase // public void testMorphXmlTypeMapping() throws Exception { - assertFalse(entityMappings().ormPersistentTypes().hasNext()); - assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEntities().isEmpty()); - assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty()); - - OrmPersistentType embeddablePersistentType = entityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - OrmPersistentType mappedSuperclassPersistentType = entityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3"); + assertFalse(getEntityMappings().ormPersistentTypes().hasNext()); + assertTrue(getOrmResource().getEntityMappings().getMappedSuperclasses().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEntities().isEmpty()); + assertTrue(getOrmResource().getEntityMappings().getEmbeddables().isEmpty()); + + OrmPersistentType embeddablePersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3"); - OrmPersistentType ormPersistentType = entityMappings().ormPersistentTypes().next(); + OrmPersistentType ormPersistentType = getEntityMappings().ormPersistentTypes().next(); assertEquals(mappedSuperclassPersistentType, ormPersistentType); assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, ormPersistentType.getMapping().getKey()); ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY); - assertEquals(0, ormResource().getEntityMappings().getMappedSuperclasses().size()); - assertEquals(1, ormResource().getEntityMappings().getEntities().size()); - assertEquals(2, ormResource().getEntityMappings().getEmbeddables().size()); + assertEquals(0, getOrmResource().getEntityMappings().getMappedSuperclasses().size()); + assertEquals(1, getOrmResource().getEntityMappings().getEntities().size()); + assertEquals(2, getOrmResource().getEntityMappings().getEmbeddables().size()); - Iterator<OrmPersistentType> ormPersistentTypes = entityMappings().ormPersistentTypes(); + Iterator<OrmPersistentType> ormPersistentTypes = getEntityMappings().ormPersistentTypes(); //the same OrmPersistentTypes should still be in the context model assertEquals(ormPersistentTypes.next(), entityPersistentType); assertEquals(ormPersistentTypes.next(), embeddablePersistentType); assertEquals(ormPersistentTypes.next(), mappedSuperclassPersistentType); - assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName()); - assertEquals("model.Foo3", ormResource().getEntityMappings().getEmbeddables().get(1).getClassName()); + assertEquals("model.Foo", getOrmResource().getEntityMappings().getEmbeddables().get(0).getClassName()); + assertEquals("model.Foo3", getOrmResource().getEntityMappings().getEmbeddables().get(1).getClassName()); } public void testAddSpecifiedPersistentAttribute() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); XmlBasic basic = entity.getAttributes().getBasics().get(0); assertEquals("basicAttribute", basic.getName()); @@ -163,7 +163,7 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testRemoveSpecifiedPersistentAttribute() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute"); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute"); @@ -171,7 +171,7 @@ public class OrmPersistentTypeTests extends ContextModelTestCase entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute"); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); assertEquals("basicAttribute", entity.getAttributes().getBasics().get(0).getName()); assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName()); assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName()); @@ -201,8 +201,8 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testRemoveId() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "idAttribute"); assertEquals("idAttribute", entity.getAttributes().getIds().get(0).getName()); @@ -212,8 +212,8 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testRemoveBasic() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicAttribute"); assertEquals("basicAttribute", entity.getAttributes().getBasics().get(0).getName()); @@ -223,8 +223,8 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testRemoveVersion() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionAttribute"); assertEquals("versionAttribute", entity.getAttributes().getVersions().get(0).getName()); @@ -234,8 +234,8 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testRemoveEmbedded() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, "embeddedAttribute"); assertEquals("embeddedAttribute", entity.getAttributes().getEmbeddeds().get(0).getName()); @@ -245,8 +245,8 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testRemoveTransient() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); entityPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientAttribute"); assertEquals("transientAttribute", entity.getAttributes().getTransients().get(0).getName()); @@ -256,8 +256,8 @@ public class OrmPersistentTypeTests extends ContextModelTestCase } public void testUpdateSpecifiedPersistentAttributes() throws Exception { - OrmPersistentType entityPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); - XmlEntity entity = ormResource().getEntityMappings().getEntities().get(0); + OrmPersistentType entityPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2"); + XmlEntity entity = getOrmResource().getEntityMappings().getEntities().get(0); entity.setAttributes(OrmFactory.eINSTANCE.createAttributes()); XmlBasicImpl basic = OrmFactory.eINSTANCE.createXmlBasicImpl(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java index 8f0dfae4da..d57fc22018 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java @@ -36,8 +36,8 @@ public class OrmPrimaryKeyJoinColumnTests 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 { @@ -76,11 +76,11 @@ public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0); assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName()); @@ -106,11 +106,11 @@ public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0); assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName()); @@ -128,11 +128,11 @@ public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase } public void testUpdateSpecifiedReferencedColumnName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0); assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName()); @@ -158,11 +158,11 @@ public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedReferencedColumnName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0); assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName()); @@ -237,11 +237,11 @@ public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase public void testUpdateSpecifiedColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0); assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition()); @@ -267,11 +267,11 @@ public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase } public void testModifySpecifiedColumnDefinition() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0); assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java index 1323d381d3..77838ccc83 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmQueryHintTests.java @@ -32,16 +32,16 @@ public class OrmQueryHintTests 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); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0); - XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); + XmlQueryHint queryHintResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); assertNull(ormQueryHint.getName()); assertNull(queryHintResource.getName()); @@ -58,11 +58,11 @@ public class OrmQueryHintTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0); - XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); + XmlQueryHint queryHintResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); assertNull(ormQueryHint.getName()); assertNull(queryHintResource.getName()); @@ -79,11 +79,11 @@ public class OrmQueryHintTests extends ContextModelTestCase } public void testUpdateValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0); - XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); + XmlQueryHint queryHintResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); assertNull(ormQueryHint.getValue()); assertNull(queryHintResource.getValue()); @@ -100,11 +100,11 @@ public class OrmQueryHintTests extends ContextModelTestCase } public void testModifyValue() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmQueryHint ormQueryHint = ormEntity.addNamedQuery(0).addHint(0); - XmlQueryHint queryHintResource = ormResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); + XmlQueryHint queryHintResource = getOrmResource().getEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0); assertNull(ormQueryHint.getValue()); assertNull(queryHintResource.getValue()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java index e150408d8a..f30a095726 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java @@ -45,8 +45,8 @@ public class OrmSecondaryTableTests 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 { @@ -85,9 +85,9 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); //set name in the resource model, verify context model updated entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl()); @@ -107,9 +107,9 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); //set name in the context model, verify resource model modified OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0); @@ -131,7 +131,7 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUpdateDefaultNameFromJavaTable() throws Exception { 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(); ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO"); @@ -149,9 +149,9 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testUpdateSpecifiedSchema() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); //set schema in the resource model, verify context model updated entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl()); @@ -171,9 +171,9 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testModifySpecifiedSchema() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); //set schema in the context model, verify resource model modified OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0); @@ -195,7 +195,7 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUpdateDefaultSchemaFromJavaTable() throws Exception { 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(); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); @@ -219,8 +219,8 @@ public class OrmSecondaryTableTests extends ContextModelTestCase createTestEntity(); createTestSubType(); - OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity parentOrmEntity = (OrmEntity) parentOrmPersistentType.getMapping(); OrmEntity childOrmEntity = (OrmEntity) childOrmPersistentType.getMapping(); @@ -239,16 +239,16 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception { 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(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); ormSecondaryTable.setSpecifiedName("FOO"); assertNull(ormSecondaryTable.getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", ormSecondaryTable.getDefaultSchema()); - entityMappings().setSpecifiedSchema("BAR"); + getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); SecondaryTable javaSecondaryTable = ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0); @@ -256,17 +256,17 @@ public class OrmSecondaryTableTests extends ContextModelTestCase javaSecondaryTable.setSpecifiedSchema("JAVA_SCHEMA"); assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); //schema is not defaulted from underlying java - entityMappings().setSpecifiedSchema(null); + getEntityMappings().setSpecifiedSchema(null); assertEquals("FOO", ormSecondaryTable.getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); assertNull(ormSecondaryTable.getDefaultSchema()); } public void testUpdateSpecifiedCatalog() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); //set catalog in the resource model, verify context model updated entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTableImpl()); @@ -286,9 +286,9 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testModifySpecifiedCatalog() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); //set catalog in the context model, verify resource model modified OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0); @@ -310,7 +310,7 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUpdateDefaultCatalogFromJavaTable() throws Exception { 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(); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); @@ -332,16 +332,16 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception { 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(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); ormSecondaryTable.setSpecifiedName("FOO"); assertNull(ormSecondaryTable.getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); assertEquals("FOO", ormSecondaryTable.getDefaultCatalog()); - entityMappings().setSpecifiedCatalog("BAR"); + getEntityMappings().setSpecifiedCatalog("BAR"); assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); SecondaryTable javaSecondaryTable = ormEntity.getJavaEntity().addSpecifiedSecondaryTable(0); @@ -349,18 +349,18 @@ public class OrmSecondaryTableTests extends ContextModelTestCase javaSecondaryTable.setSpecifiedCatalog("JAVA_CATALOG"); assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); //schema is not defaulted from underlying java - entityMappings().setSpecifiedCatalog(null); + getEntityMappings().setSpecifiedCatalog(null); assertEquals("FOO", ormSecondaryTable.getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); assertNull(ormSecondaryTable.getDefaultCatalog()); } public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0); @@ -393,10 +393,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); @@ -419,10 +419,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); @@ -455,10 +455,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testUpdatePrimaryKeyJoinColumns() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumnImpl()); @@ -506,10 +506,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUniqueConstraints() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.uniqueConstraints(); @@ -531,10 +531,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testUniqueConstraintsSize() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); assertEquals(0, ormSecondaryTable.uniqueConstraintsSize()); @@ -551,10 +551,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testAddUniqueConstraint() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); @@ -570,10 +570,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testAddUniqueConstraint2() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); @@ -589,10 +589,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testRemoveUniqueConstraint() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); @@ -632,10 +632,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testMoveUniqueConstraint() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO"); @@ -670,10 +670,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase } public void testUpdateUniqueConstraints() throws Exception { - OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType persistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0); XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl(); @@ -728,7 +728,7 @@ public class OrmSecondaryTableTests extends ContextModelTestCase public void testUniqueConstraintsFromJava() throws Exception { 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 = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java index 5d54536317..705eee1e1a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java @@ -32,8 +32,8 @@ public class OrmSequenceGeneratorTests 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 { @@ -72,8 +72,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set name in the resource model, verify context model updated sequenceGeneratorResource.setName("FOO"); @@ -87,8 +87,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set name in the context model, verify resource model modified sequenceGenerator.setName("FOO"); @@ -102,8 +102,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedSequenceName() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set name in the resource model, verify context model updated sequenceGeneratorResource.setSequenceName("FOO"); @@ -117,8 +117,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedSequenceName() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set name in the context model, verify resource model modified sequenceGenerator.setSpecifiedSequenceName("FOO"); @@ -132,8 +132,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedInitialValue() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set initial value in the resource model, verify context model updated sequenceGeneratorResource.setInitialValue(Integer.valueOf(10)); @@ -152,8 +152,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedInitialValue() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set initial value in the context model, verify resource model modified sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(10)); @@ -171,8 +171,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedAllocationSize() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set allocation size in the resource model, verify context model updated sequenceGeneratorResource.setAllocationSize(Integer.valueOf(10)); @@ -191,8 +191,8 @@ public class OrmSequenceGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedAllocationSize() throws Exception { - SequenceGenerator sequenceGenerator = entityMappings().addSequenceGenerator(0); - XmlSequenceGenerator sequenceGeneratorResource = ormResource().getEntityMappings().getSequenceGenerators().get(0); + SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0); + XmlSequenceGenerator sequenceGeneratorResource = getOrmResource().getEntityMappings().getSequenceGenerators().get(0); //set allocation size in the context model, verify resource model modified sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(10)); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java index ac4af0ec38..66350cafe1 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableGeneratorTests.java @@ -43,8 +43,8 @@ public class OrmTableGeneratorTests 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 { @@ -83,8 +83,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setName("FOO"); @@ -98,8 +98,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setName("FOO"); @@ -113,8 +113,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedInitialValue() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set initial value in the resource model, verify context model updated tableGeneratorResource.setInitialValue(Integer.valueOf(10)); @@ -133,8 +133,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedInitialValue() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set initial value in the context model, verify resource model modified tableGenerator.setSpecifiedInitialValue(Integer.valueOf(10)); @@ -152,8 +152,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedAllocationSize() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set allocation size in the resource model, verify context model updated tableGeneratorResource.setAllocationSize(Integer.valueOf(10)); @@ -172,8 +172,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedAllocationSize() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set allocation size in the context model, verify resource model modified tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(10)); @@ -191,8 +191,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedTable() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setTable("FOO"); @@ -206,8 +206,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedTable() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setSpecifiedTable("FOO"); @@ -221,8 +221,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedSchema() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setSchema("FOO"); @@ -236,8 +236,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedSchema() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setSpecifiedSchema("FOO"); @@ -251,20 +251,20 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); assertNull(tableGenerator.getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", tableGenerator.getDefaultSchema()); - entityMappings().setSpecifiedSchema("BAR"); + getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", tableGenerator.getDefaultSchema()); } public void testUpdateSpecifiedCatalog() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setCatalog("FOO"); @@ -278,8 +278,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedCatalog() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setSpecifiedCatalog("FOO"); @@ -293,8 +293,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedPkColumnName() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setPkColumnName("FOO"); @@ -308,8 +308,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedPkColumnName() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setSpecifiedPkColumnName("FOO"); @@ -323,8 +323,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedValueColumnName() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setValueColumnName("FOO"); @@ -338,8 +338,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedValueColumnName() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setSpecifiedValueColumnName("FOO"); @@ -353,8 +353,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateSpecifiedPkColumnValue() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the resource model, verify context model updated tableGeneratorResource.setPkColumnValue("FOO"); @@ -368,8 +368,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testModifySpecifiedPkColumnValue() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); //set name in the context model, verify resource model modified tableGenerator.setSpecifiedPkColumnValue("FOO"); @@ -384,8 +384,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase public void testUniqueConstraints() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); ListIterator<OrmUniqueConstraint> uniqueConstraints = tableGenerator.uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); @@ -406,8 +406,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUniqueConstraintsSize() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); assertEquals(0, tableGenerator.uniqueConstraintsSize()); @@ -423,8 +423,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testAddUniqueConstraint() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR"); @@ -439,8 +439,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testAddUniqueConstraint2() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR"); @@ -455,8 +455,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testRemoveUniqueConstraint() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR"); @@ -495,8 +495,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testMoveUniqueConstraint() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO"); tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR"); @@ -530,8 +530,8 @@ public class OrmTableGeneratorTests extends ContextModelTestCase } public void testUpdateUniqueConstraints() throws Exception { - TableGenerator tableGenerator = entityMappings().addTableGenerator(0); - XmlTableGenerator tableGeneratorResource = ormResource().getEntityMappings().getTableGenerators().get(0); + TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0); + XmlTableGenerator tableGeneratorResource = getOrmResource().getEntityMappings().getTableGenerators().get(0); XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraintImpl(); tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource); @@ -584,7 +584,7 @@ public class OrmTableGeneratorTests extends ContextModelTestCase public void testUniqueConstraintsFromJava() throws Exception { 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); OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentType.attributes().next().getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java index 5fba977c37..6dc1d4443d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java @@ -41,8 +41,8 @@ public class OrmTableTests 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 { @@ -81,10 +81,10 @@ public class OrmTableTests extends ContextModelTestCase } public void testUpdateSpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmTable ormTable = ormEntity.getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormTable.getSpecifiedName()); assertNull(entityResource.getTable()); @@ -109,9 +109,9 @@ public class OrmTableTests extends ContextModelTestCase } public void testModifySpecifiedName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmTable ormTable = ((OrmEntity) ormPersistentType.getMapping()).getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormTable.getSpecifiedName()); assertNull(entityResource.getTable()); @@ -129,7 +129,7 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultNameFromJavaTable() throws Exception { 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(); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); @@ -139,14 +139,14 @@ public class OrmTableTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); ormEntity.setSpecifiedMetadataComplete(null); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("Foo", ormEntity.getTable().getDefaultName()); ormEntity.getTable().setSpecifiedName("Bar"); @@ -154,7 +154,7 @@ public class OrmTableTests extends ContextModelTestCase } public void testUpdateDefaultNameNoJava() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); assertEquals("Foo", ormEntity.getTable().getDefaultName()); } @@ -162,7 +162,7 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultNameFromEntityName() throws Exception { 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(); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); @@ -184,8 +184,8 @@ public class OrmTableTests extends ContextModelTestCase createTestEntity(); createTestSubType(); - OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping(); OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping(); @@ -202,10 +202,10 @@ public class OrmTableTests extends ContextModelTestCase } public void testUpdateSpecifiedSchema() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmTable ormTable = ormEntity.getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormTable.getSpecifiedSchema()); assertNull(entityResource.getTable()); @@ -232,7 +232,7 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultSchemaFromJavaTable() throws Exception { 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(); assertNull(ormEntity.getTable().getDefaultSchema()); @@ -242,14 +242,14 @@ public class OrmTableTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE); assertNull(ormEntity.getTable().getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertNull(ormEntity.getTable().getDefaultSchema()); ormEntity.setSpecifiedMetadataComplete(null); assertNull(ormEntity.getTable().getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("Foo", ormEntity.getTable().getDefaultSchema()); ormEntity.getTable().setSpecifiedName("Bar"); @@ -259,7 +259,7 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultSchemaNoJava() throws Exception { createTestEntity(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); assertNull(ormEntity.getTable().getDefaultSchema()); } @@ -268,8 +268,8 @@ public class OrmTableTests extends ContextModelTestCase createTestEntity(); createTestSubType(); - OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping(); OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping(); @@ -288,14 +288,14 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception { 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(); assertNull(ormEntity.getTable().getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", ormEntity.getTable().getDefaultSchema()); - entityMappings().setSpecifiedSchema("BAR"); + getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", ormEntity.getTable().getDefaultSchema()); ormEntity.getJavaEntity().getTable().setSpecifiedSchema("JAVA_SCHEMA"); @@ -306,10 +306,10 @@ public class OrmTableTests extends ContextModelTestCase assertEquals("BAR", ormEntity.getTable().getDefaultSchema()); - entityMappings().setSpecifiedSchema(null); + getEntityMappings().setSpecifiedSchema(null); assertEquals("FOO", ormEntity.getTable().getDefaultSchema()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); assertNull(ormEntity.getTable().getDefaultSchema()); ormEntity.getTable().setSpecifiedName(null); @@ -317,10 +317,10 @@ public class OrmTableTests extends ContextModelTestCase } public void testModifySpecifiedSchema() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmTable ormTable = ormEntity.getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormTable.getSpecifiedSchema()); assertNull(entityResource.getTable()); @@ -336,10 +336,10 @@ public class OrmTableTests extends ContextModelTestCase } public void testUpdateSpecifiedCatalog() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmTable ormTable = ormEntity.getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormTable.getSpecifiedCatalog()); assertNull(entityResource.getTable()); @@ -364,10 +364,10 @@ public class OrmTableTests extends ContextModelTestCase } public void testModifySpecifiedCatalog() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); OrmTable ormTable = ormEntity.getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); assertNull(ormTable.getSpecifiedCatalog()); assertNull(entityResource.getTable()); @@ -385,7 +385,7 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultCatalogFromJavaTable() throws Exception { 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(); assertNull(ormEntity.getTable().getDefaultCatalog()); @@ -395,14 +395,14 @@ public class OrmTableTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE); assertNull(ormEntity.getTable().getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertNull(ormEntity.getTable().getDefaultCatalog()); ormEntity.setSpecifiedMetadataComplete(null); assertNull(ormEntity.getTable().getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("Foo", ormEntity.getTable().getDefaultCatalog()); ormEntity.getTable().setSpecifiedName("Bar"); @@ -412,7 +412,7 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultCatalogNoJava() throws Exception { createTestEntity(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); assertNull(ormEntity.getTable().getDefaultCatalog()); } @@ -421,8 +421,8 @@ public class OrmTableTests extends ContextModelTestCase createTestEntity(); createTestSubType(); - OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); + OrmPersistentType parentOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + OrmPersistentType childOrmPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild"); OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping(); OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping(); @@ -441,14 +441,14 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception { 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(); assertNull(ormEntity.getTable().getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); assertEquals("FOO", ormEntity.getTable().getDefaultCatalog()); - entityMappings().setSpecifiedCatalog("BAR"); + getEntityMappings().setSpecifiedCatalog("BAR"); assertEquals("BAR", ormEntity.getTable().getDefaultCatalog()); ormEntity.getJavaEntity().getTable().setSpecifiedCatalog("JAVA_CATALOG"); @@ -459,10 +459,10 @@ public class OrmTableTests extends ContextModelTestCase assertEquals("BAR", ormEntity.getTable().getDefaultCatalog()); - entityMappings().setSpecifiedCatalog(null); + getEntityMappings().setSpecifiedCatalog(null); assertEquals("FOO", ormEntity.getTable().getDefaultCatalog()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); assertNull(ormEntity.getTable().getDefaultCatalog()); ormEntity.getTable().setSpecifiedName(null); @@ -494,13 +494,13 @@ public class OrmTableTests extends ContextModelTestCase public void testUniqueConstraints() throws Exception { 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(); ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable(); entityResource.setTable(tableResource); @@ -522,12 +522,12 @@ public class OrmTableTests extends ContextModelTestCase public void testUniqueConstraintsSize() throws Exception { 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(); assertEquals(0, ormEntity.getTable().uniqueConstraintsSize()); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable(); entityResource.setTable(tableResource); @@ -545,7 +545,7 @@ public class OrmTableTests extends ContextModelTestCase public void testAddUniqueConstraint() throws Exception { 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(); OrmTable table = ormEntity.getTable(); @@ -553,7 +553,7 @@ public class OrmTableTests extends ContextModelTestCase table.addUniqueConstraint(0).addColumnName(0, "BAR"); table.addUniqueConstraint(0).addColumnName(0, "BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = entityResource.getTable(); ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator(); @@ -567,7 +567,7 @@ public class OrmTableTests extends ContextModelTestCase public void testAddUniqueConstraint2() throws Exception { 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(); OrmTable table = ormEntity.getTable(); @@ -575,7 +575,7 @@ public class OrmTableTests extends ContextModelTestCase table.addUniqueConstraint(1).addColumnName(0, "BAR"); table.addUniqueConstraint(0).addColumnName(0, "BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = entityResource.getTable(); ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator(); @@ -589,7 +589,7 @@ public class OrmTableTests extends ContextModelTestCase public void testRemoveUniqueConstraint() throws Exception { 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(); OrmTable table = ormEntity.getTable(); @@ -597,7 +597,7 @@ public class OrmTableTests extends ContextModelTestCase table.addUniqueConstraint(1).addColumnName(0, "BAR"); table.addUniqueConstraint(2).addColumnName(0, "BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = entityResource.getTable(); assertEquals(3, tableResource.getUniqueConstraints().size()); @@ -635,7 +635,7 @@ public class OrmTableTests extends ContextModelTestCase public void testMoveUniqueConstraint() throws Exception { 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(); OrmTable table = ormEntity.getTable(); @@ -643,7 +643,7 @@ public class OrmTableTests extends ContextModelTestCase table.addUniqueConstraint(1).addColumnName(0, "BAR"); table.addUniqueConstraint(2).addColumnName(0, "BAZ"); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = entityResource.getTable(); assertEquals(3, tableResource.getUniqueConstraints().size()); @@ -676,12 +676,12 @@ public class OrmTableTests extends ContextModelTestCase public void testUpdateUniqueConstraints() throws Exception { 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(); OrmTable table = ormEntity.getTable(); - XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); + XmlEntity entityResource = getOrmResource().getEntityMappings().getEntities().get(0); XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable(); entityResource.setTable(tableResource); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java index 369fc2ad05..ab60e4543c 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTransientMappingTests.java @@ -43,8 +43,8 @@ public class OrmTransientMappingTests 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 createTestEntityTransientMapping() throws Exception { @@ -65,10 +65,10 @@ public class OrmTransientMappingTests extends ContextModelTestCase }); } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientMapping"); OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping(); - XmlTransient transientResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0); + XmlTransient transientResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0); assertEquals("transientMapping", xmlTransientnMapping.getName()); assertEquals("transientMapping", transientResource.getName()); @@ -85,10 +85,10 @@ public class OrmTransientMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transientMapping"); OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping(); - XmlTransient transientResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0); + XmlTransient transientResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0); assertEquals("transientMapping", xmlTransientnMapping.getName()); assertEquals("transientMapping", transientResource.getName()); @@ -108,7 +108,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMappingNoUnderylingJavaAttribute() throws Exception { createTestEntityTransientMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -127,7 +127,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase //@Enumerated(EnumType.STRING) public void testVirtualMappingMetadataCompleteFalse() throws Exception { createTestEntityTransientMapping(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -137,7 +137,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testVirtualMappingMetadataCompleteTrue() throws Exception { createTestEntityTransientMapping(); - 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); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -154,7 +154,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testSpecifiedMapping() throws Exception { createTestEntityTransientMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "id"); assertEquals(1, ormPersistentType.virtualAttributesSize()); @@ -166,7 +166,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToIdMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -181,7 +181,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToVersionMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -196,7 +196,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToTransientMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -211,7 +211,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToEmbeddedMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -226,7 +226,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToEmbeddedIdMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -241,7 +241,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToOneToOneMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -256,7 +256,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToOneToManyMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -271,7 +271,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToManyToOneMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); @@ -286,7 +286,7 @@ public class OrmTransientMappingTests extends ContextModelTestCase public void testTransientMorphToManyToManyMapping() throws Exception { createTestEntityTransientMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, "transient"); TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java index b145ddcf7f..fcd501aa08 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmVersionMappingTests.java @@ -49,8 +49,8 @@ public class OrmVersionMappingTests 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 createTestEntityVersionMapping() throws Exception { @@ -76,10 +76,10 @@ public class OrmVersionMappingTests extends ContextModelTestCase } public void testUpdateName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping"); OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping(); - XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); + XmlVersion versionResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); assertEquals("versionMapping", ormVersionMapping.getName()); assertEquals("versionMapping", versionResource.getName()); @@ -96,10 +96,10 @@ public class OrmVersionMappingTests extends ContextModelTestCase } public void testModifyName() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping"); OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping(); - XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); + XmlVersion versionResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); assertEquals("versionMapping", ormVersionMapping.getName()); assertEquals("versionMapping", versionResource.getName()); @@ -116,10 +116,10 @@ public class OrmVersionMappingTests extends ContextModelTestCase } public void testUpdateTemporal() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping"); OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping(); - XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); + XmlVersion versionResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); assertNull(ormVersionMapping.getSpecifiedConverter()); assertNull(versionResource.getTemporal()); @@ -144,10 +144,10 @@ public class OrmVersionMappingTests extends ContextModelTestCase } public void testModifyTemporal() throws Exception { - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "versionMapping"); OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping(); - XmlVersion versionResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); + XmlVersion versionResource = getOrmResource().getEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0); assertNull(ormVersionMapping.getSpecifiedConverter()); assertNull(versionResource.getTemporal()); @@ -178,7 +178,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMappingNoUnderylingJavaAttribute() throws Exception { createTestEntityVersionMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "foo"); assertEquals(2, ormPersistentType.virtualAttributesSize()); @@ -222,7 +222,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase //@Enumerated(EnumType.STRING) public void testVirtualMappingMetadataCompleteFalse() throws Exception { createTestEntityVersionMapping(); - 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); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -246,7 +246,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVirtualMappingMetadataCompleteTrue() throws Exception { createTestEntityVersionMapping(); - 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); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(2, ormPersistentType.virtualAttributesSize()); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next(); @@ -276,7 +276,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testSpecifiedMapping() throws Exception { createTestEntityVersionMapping(); - 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); ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "id"); assertEquals(1, ormPersistentType.virtualAttributesSize()); @@ -312,7 +312,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToIdMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -332,7 +332,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToBasicMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -352,7 +352,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToTransientMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -371,7 +371,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToEmbeddedMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -390,7 +390,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToEmbeddedIdMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -409,7 +409,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToOneToOneMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -428,7 +428,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToOneToManyMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -447,7 +447,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToManyToOneMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); @@ -466,7 +466,7 @@ public class OrmVersionMappingTests extends ContextModelTestCase public void testVersionMorphToManyToManyMapping() throws Exception { createTestEntityVersionMapping(); - 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); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, "version"); VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java index 2cc31866cf..d162c08524 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java @@ -28,11 +28,11 @@ public class OrmXmlTests extends ContextModelTestCase @Override protected void setUp() throws Exception { super.setUp(); - xmlPersistenceUnit().setName("foo"); + getXmlPersistenceUnit().setName("foo"); 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); } protected PersistenceXml persistenceXml() { @@ -40,11 +40,11 @@ public class OrmXmlTests extends ContextModelTestCase } protected OrmXml ormXml() { - return (OrmXml) persistenceUnit().mappingFileRefs().next().getMappingFile(); + return (OrmXml) getPersistenceUnit().mappingFileRefs().next().getMappingFile(); } public void testUpdateAddEntityMappings() throws Exception { - OrmResource ormResource = ormResource(); + OrmResource ormResource = getOrmResource(); ormResource.getContents().clear(); ormResource.save(null); @@ -58,7 +58,7 @@ public class OrmXmlTests extends ContextModelTestCase } public void testModifyAddEntityMappings() { - OrmResource ormResource = ormResource(); + OrmResource ormResource = getOrmResource(); ormResource.getContents().remove(ormResource.getEntityMappings()); assertNull(ormResource.getEntityMappings()); @@ -81,7 +81,7 @@ public class OrmXmlTests extends ContextModelTestCase } public void testUpdateRemoveEntityMappings() throws Exception { - OrmResource ormResource = ormResource(); + OrmResource ormResource = getOrmResource(); assertNotNull(ormXml().getRoot()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java index 4e74faad75..6728910006 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java @@ -31,21 +31,21 @@ public class PersistenceUnitDefaultsTests 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); } protected OrmPersistenceUnitDefaults persistenceUnitDefaults() { - return entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults(); + return getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults(); } public void testIsAllFeaturesUnset() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata(); - ormResource().getEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata); assertTrue(persistenceUnitMetadata.isAllFeaturesUnset()); org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults(); @@ -84,286 +84,286 @@ public class PersistenceUnitDefaultsTests extends ContextModelTestCase public void testUpdateSchema() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set schema in the resource model, verify context model updated - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA"); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA"); assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); //set schema to null in the resource model - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); } public void testModifySchema() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set schema in the context model, verify resource model modified persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA"); assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); //set schema to null in the context model persistenceUnitDefaults.setSpecifiedSchema(null); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); } public void testModifySchema2() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set schema in the context model, verify resource model modified persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA"); assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); //set another element on the persistence-unit-defaults element so it doesn't get removed - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG"); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG"); //set schema to null in the context model persistenceUnitDefaults.setSpecifiedSchema(null); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); } public void testModifySchema3() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //set schema in the context model, verify resource model modified persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA"); assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema()); - assertEquals("MY_SCHEMA", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); + assertEquals("MY_SCHEMA", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema()); //set schema to null in the context model persistenceUnitDefaults.setSpecifiedSchema(null); assertNull(persistenceUnitDefaults.getSchema()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); } public void testUpdateCatalog() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set catalog in the resource model, verify context model updated - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG"); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG"); assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); //set catalog to null in the resource model - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); } public void testModifyCatalog() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set catalog in the context model, verify resource model modified persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG"); assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); //set catalog to null in the context model persistenceUnitDefaults.setSpecifiedCatalog(null); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); } public void testModifyCatalog2() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set catalog in the context model, verify resource model modified persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG"); assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); //set another element on the persistence-unit-defaults element so it doesn't get removed - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA"); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA"); //set catalog to null in the context model persistenceUnitDefaults.setSpecifiedCatalog(null); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); } public void testModifyCatalog3() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //set catalog in the context model, verify resource model modified persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG"); assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog()); - assertEquals("MY_CATALOG", ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); + assertEquals("MY_CATALOG", getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog()); //set catalog to null in the context model persistenceUnitDefaults.setSpecifiedCatalog(null); assertNull(persistenceUnitDefaults.getCatalog()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); } public void testUpdateCascadePersist() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set cascadePersist in the resource model, verify context model updated - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true); assertTrue(persistenceUnitDefaults.isCascadePersist()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); //set cascadePersist to null in the resource model, persistence-unit-defaults tag not removed - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); + assertFalse(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); } public void testModifyCascadePersist() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set cascadePersist in the context model, verify resource model modified persistenceUnitDefaults.setCascadePersist(true); assertTrue(persistenceUnitDefaults.isCascadePersist()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); //set cascadePersist to null in the context model persistenceUnitDefaults.setCascadePersist(false); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); } public void testModifyCascadePersist2() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set cascadePersist in the context model, verify resource model modified persistenceUnitDefaults.setCascadePersist(true); assertTrue(persistenceUnitDefaults.isCascadePersist()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); //set another element on the persistence-unit-defaults element so it doesn't get removed - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG"); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG"); //set cascadePersist to null in the context model persistenceUnitDefaults.setCascadePersist(false); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); + assertFalse(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); } public void testModifyCascadePersist3() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //set cascadePersist in the context model, verify resource model modified persistenceUnitDefaults.setCascadePersist(true); assertTrue(persistenceUnitDefaults.isCascadePersist()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist()); //set cascadePersist to null in the context model persistenceUnitDefaults.setCascadePersist(false); assertFalse(persistenceUnitDefaults.isCascadePersist()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); } public void testUpdateAccess() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set access in the resource model, verify context model updated - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD); assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); //set access to null in the resource model - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); } public void testModifyAccess() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set access in the context model, verify resource model modified persistenceUnitDefaults.setAccess(AccessType.PROPERTY); assertEquals(AccessType.PROPERTY, persistenceUnitDefaults.getAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY, getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); //set access to null in the context model persistenceUnitDefaults.setAccess(null); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); } public void testModifyAccess2() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set access in the context model, verify resource model modified persistenceUnitDefaults.setAccess(AccessType.FIELD); assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); //set another element on the persistence-unit-defaults element so it doesn't get removed - ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true); //set access to null in the context model persistenceUnitDefaults.setAccess(null); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); } public void testModifyAccess3() throws Exception { OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults(); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //set access in the context model, verify resource model modified persistenceUnitDefaults.setAccess(AccessType.FIELD); assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess()); - assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); + assertEquals(org.eclipse.jpt.core.resource.orm.AccessType.FIELD, getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess()); //set access to null in the context model persistenceUnitDefaults.setAccess(null); assertNull(persistenceUnitDefaults.getAccess()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults()); } }
\ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java index feada5432d..70a3c03e71 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java @@ -29,17 +29,17 @@ public class PersistenceUnitMetadataTests 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); } protected PersistenceUnitMetadata persistenceUnitMetadata() { - return entityMappings().getPersistenceUnitMetadata(); + return getEntityMappings().getPersistenceUnitMetadata(); } public void testIsAllFeaturesUnset() throws Exception { org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata(); - ormResource().getEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata); assertTrue(persistenceUnitMetadata.isAllFeaturesUnset()); persistenceUnitMetadata.setXmlMappingMetadataComplete(true); @@ -53,53 +53,53 @@ public class PersistenceUnitMetadataTests extends ContextModelTestCase } public void testUpdateXmlMappingMetadataComplete() throws Exception { - PersistenceUnitMetadata persistenceUnitMetadata = entityMappings().getPersistenceUnitMetadata(); + PersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata(); assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set xmlMappingMetadataComplete in the resource model, verify context model updated - ormResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + getOrmResource().getEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); //set xmlMappingMetadataComplete to null in the resource model - ormResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); + assertFalse(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); } public void testModifyXmlMappingMetadataComplete() throws Exception { - PersistenceUnitMetadata persistenceUnitMetadata = entityMappings().getPersistenceUnitMetadata(); + PersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata(); assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set xmlMappingMetadataComplete in the context model, verify resource model modified persistenceUnitMetadata.setXmlMappingMetadataComplete(true); assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); //set xmlMappingMetadataComplete to null in the context model persistenceUnitMetadata.setXmlMappingMetadataComplete(false); assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); } public void testModifyXmlMappingMetadataComplete2() throws Exception { - PersistenceUnitMetadata persistenceUnitMetadata = entityMappings().getPersistenceUnitMetadata(); + PersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata(); assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertNull(ormResource().getEntityMappings().getPersistenceUnitMetadata()); + assertNull(getOrmResource().getEntityMappings().getPersistenceUnitMetadata()); //set xmlMappingMetadataComplete in the context model, verify resource model modified persistenceUnitMetadata.setXmlMappingMetadataComplete(true); assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertTrue(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); + assertTrue(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); //set xmlMappingMetadataComplete to null in the context model //set another element on the persistence-unit-metadata element so it doesn't get removed - ormResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); + getOrmResource().getEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults()); persistenceUnitMetadata.setXmlMappingMetadataComplete(false); assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete()); - assertFalse(ormResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); + assertFalse(getOrmResource().getEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete()); } }
\ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java index 3e44c6de2b..3773551b2b 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/ClassRefTests.java @@ -24,8 +24,8 @@ public class ClassRefTests extends ContextModelTestCase } public void testUpdateClassName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add class ref XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); @@ -56,8 +56,8 @@ public class ClassRefTests extends ContextModelTestCase } public void testModifyClassName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add class ref XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); @@ -93,20 +93,20 @@ public class ClassRefTests extends ContextModelTestCase public void testGetPersistentType() throws Exception { createTestType(); - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); xmlClassRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME); xmlPersistenceUnit.getClasses().add(xmlClassRef); - ClassRef classRef = classRef(); + ClassRef classRef = getSpecifiedClassRef(); assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRef.getJavaPersistentType().getName()); //test setting to a class that does not exist in the project xmlClassRef.setJavaClass("com.foo.Bar"); - classRef = classRef(); + classRef = getSpecifiedClassRef(); assertNull(classRef.getJavaPersistentType()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java index 1854a15312..caadd6cb26 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/MappingFileRefTests.java @@ -24,12 +24,12 @@ public class MappingFileRefTests extends ContextModelTestCase } protected MappingFileRef mappingFileRef() { - return persistenceUnit().mappingFileRefs().next(); + return getPersistenceUnit().mappingFileRefs().next(); } public void testUpdateFileName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add mapping file ref XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); @@ -62,8 +62,8 @@ public class MappingFileRefTests extends ContextModelTestCase } public void testModifyFileName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add mapping file ref XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java index 9c76269325..6d19ac3b81 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java @@ -28,7 +28,7 @@ public class PersistenceTests extends ContextModelTestCase } public void testUpdateAddPersistenceUnit() throws Exception { - PersistenceResource prm = persistenceResource(); + PersistenceResource prm = getPersistenceResource(); XmlPersistence xmlPersistence = prm.getPersistence(); Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence(); @@ -53,7 +53,7 @@ public class PersistenceTests extends ContextModelTestCase } public void testModifyAddPersistencUnit() { - XmlPersistence xmlPersistence = xmlPersistence(); + XmlPersistence xmlPersistence = getXmlPersistence(); Persistence persistence = persistence(); // clear xml persistence units, test that it's clear in context @@ -78,7 +78,7 @@ public class PersistenceTests extends ContextModelTestCase } public void testUpdateRemovePersistenceUnit() throws Exception { - PersistenceResource prm = persistenceResource(); + PersistenceResource prm = getPersistenceResource(); XmlPersistence xmlPersistence = prm.getPersistence(); Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence(); @@ -107,7 +107,7 @@ public class PersistenceTests extends ContextModelTestCase } public void testModifyRemovePersistenceUnit() { - XmlPersistence xmlPersistence = xmlPersistence(); + XmlPersistence xmlPersistence = getXmlPersistence(); Persistence persistence = persistence(); // add a persistence unit and test that there are two existing xml and diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java index 4ab50d113a..027aa769fc 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceUnitTests.java @@ -51,8 +51,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that names are initially equal assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName()); @@ -79,8 +79,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that names are initially equal assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName()); @@ -107,8 +107,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateTransactionType() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // 1 - initial value is default assertNull(xmlPersistenceUnit.getTransactionType()); @@ -130,8 +130,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyTransactionType() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // 1 - initial value is default assertNull(xmlPersistenceUnit.getTransactionType()); @@ -154,8 +154,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateDescription() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that descriptions are initially equal assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription()); @@ -182,8 +182,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyDescription() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that descriptions are initially equal assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription()); @@ -210,8 +210,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateProvider() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that providers are initially equal assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider()); @@ -238,8 +238,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyProvider() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that providers are initially equal assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider()); @@ -266,8 +266,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateJtaDataSource() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that jtaDataSources are initially equal assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource()); @@ -294,8 +294,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyJtaDataSource() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that jtaDataSources are initially equal assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource()); @@ -322,8 +322,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateNonJtaDataSource() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that nonJtaDataSources are initially equal assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource()); @@ -350,8 +350,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyNonJtaDataSource() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that nonJtaDataSources are initially equal assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource()); @@ -386,10 +386,10 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateImpliedMappingFileRef1() throws Exception { - PersistenceUnit persistenceUnit = persistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that there is one initially - OrmResource ormResource = ormResource(); + OrmResource ormResource = getOrmResource(); assertTrue(ormResource.exists()); assertNotNull(persistenceUnit.getImpliedMappingFileRef()); @@ -401,11 +401,11 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateImpliedMappingFileRef2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test that there is one initially - OrmResource ormResource = ormResource(); + OrmResource ormResource = getOrmResource(); assertTrue(ormResource.exists()); assertNotNull(persistenceUnit.getImpliedMappingFileRef()); @@ -421,8 +421,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateSpecifiedMappingFileRefs1() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test there are none initially assertEquals(0, xmlPersistenceUnit.getMappingFiles().size()); @@ -444,8 +444,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateSpecifiedMappingFileRefs2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two mapping file refs and test that there are two existing in xml and context XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); @@ -472,8 +472,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifySpecifiedMappingFileRefs1() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test there are none initially assertEquals(0, xmlPersistenceUnit.getMappingFiles().size()); @@ -501,8 +501,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifySpecifiedMappingFileRefs2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two mapping file refs and test that there are two existing in xml and context XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef(); @@ -527,8 +527,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateClassRefs1() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test there are none initially assertEquals(0, xmlPersistenceUnit.getClasses().size()); @@ -550,8 +550,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateClassRefs2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two class refs and test that there are two existing in xml and context XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); @@ -578,8 +578,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyClassRefs1() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test there are none initially assertEquals(0, xmlPersistenceUnit.getClasses().size()); @@ -589,7 +589,7 @@ public class PersistenceUnitTests extends ContextModelTestCase persistenceUnit.addSpecifiedClassRef().setClassName("Foo"); try { - persistenceResource().save(null); + getPersistenceResource().save(null); } catch (IOException e) { // TODO Auto-generated catch block @@ -615,8 +615,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyClassRefs2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two class refs and test that there are two existing in xml and context XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); @@ -642,42 +642,42 @@ public class PersistenceUnitTests extends ContextModelTestCase public void testImpliedClassRefs() throws Exception { createTestEntityWithPersistentInnerClass(); - ListIterator<ClassRef> classRefs = persistenceUnit().impliedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().impliedClassRefs(); assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRefs.next().getClassName()); assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName()); - jpaProject().setDiscoversAnnotatedClasses(true); - classRefs = persistenceUnit().impliedClassRefs(); + getJpaProject().setDiscoversAnnotatedClasses(true); + classRefs = getPersistenceUnit().impliedClassRefs(); assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRefs.next().getClassName()); assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName()); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - classRefs = persistenceUnit().impliedClassRefs(); + classRefs = getPersistenceUnit().impliedClassRefs(); assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName()); assertFalse(classRefs.hasNext()); removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - classRefs = persistenceUnit().impliedClassRefs(); + classRefs = getPersistenceUnit().impliedClassRefs(); assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName()); assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRefs.next().getClassName()); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); - classRefs = persistenceUnit().impliedClassRefs(); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); + classRefs = getPersistenceUnit().impliedClassRefs(); assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName()); assertFalse(classRefs.hasNext()); addXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME); - classRefs = persistenceUnit().impliedClassRefs(); + classRefs = getPersistenceUnit().impliedClassRefs(); assertFalse(classRefs.hasNext()); removeXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME); - classRefs = persistenceUnit().impliedClassRefs(); + classRefs = getPersistenceUnit().impliedClassRefs(); assertEquals(FULLY_QUALIFIED_INNER_CLASS_NAME, classRefs.next().getClassName()); assertFalse(classRefs.hasNext()); - entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_INNER_CLASS_NAME); - classRefs = persistenceUnit().impliedClassRefs(); + getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_INNER_CLASS_NAME); + classRefs = getPersistenceUnit().impliedClassRefs(); assertFalse(classRefs.hasNext()); } @@ -687,7 +687,7 @@ public class PersistenceUnitTests extends ContextModelTestCase @SuppressWarnings("unused") ICompilationUnit otherTestType = this.createTestOtherTypeEntity(); - ListIterator<ClassRef> classRefs = persistenceUnit().impliedClassRefs(); + ListIterator<ClassRef> classRefs = getPersistenceUnit().impliedClassRefs(); ClassRef testTypeClassRef = classRefs.next(); ClassRef otherTestTypeClassRef = classRefs.next(); @@ -699,7 +699,7 @@ public class PersistenceUnitTests extends ContextModelTestCase testType.findPrimaryType().rename("TestType2", false, null); - classRefs = persistenceUnit().impliedClassRefs(); + classRefs = getPersistenceUnit().impliedClassRefs(); otherTestTypeClassRef = classRefs.next(); testTypeClassRef = classRefs.next(); @@ -711,8 +711,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateExcludeUnlistedClasses() throws Exception { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // 1 - initial value is default assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses()); @@ -741,8 +741,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyExcludeUnlistedClasses() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // 1 - initial value is default assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses()); @@ -771,8 +771,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateProperties1() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test there are none initially assertNull(xmlPersistenceUnit.getProperties()); @@ -801,8 +801,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdateProperties2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two properties and test that there are two existing in xml and context XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties(); @@ -833,8 +833,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyProperties1() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // test there are none initially assertNull(xmlPersistenceUnit.getProperties()); @@ -864,8 +864,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyProperties2() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two properties and test that there are two existing in xml and context XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties(); @@ -894,8 +894,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyProperties3() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two properties and test that there are two existing in xml and context persistenceUnit.putProperty("foo", "bar", false); @@ -916,8 +916,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyProperties4() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two properties and test that there are two existing in xml and context persistenceUnit.putProperty("foo", "bar", false); @@ -952,8 +952,8 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testModifyProperties5() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); - PersistenceUnit persistenceUnit = persistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // testing duplicate keys, add four properties and test that there are four existing in xml and context persistenceUnit.putProperty("FOO", "BAR", false); @@ -977,7 +977,7 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testAccessProperty() { - PersistenceUnit persistenceUnit = persistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); // add two properties and try to access it. persistenceUnit.putProperty("foo", "bar", false); @@ -992,11 +992,11 @@ public class PersistenceUnitTests extends ContextModelTestCase } private Property persistenceUnitFirstProperty() { - return persistenceUnit().properties().next(); + return getPersistenceUnit().properties().next(); } public void testUpdatePropertyName() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); // add property for testing XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties(); @@ -1024,7 +1024,7 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testUpdatePropertyValue() { - XmlPersistenceUnit xmlPersistenceUnit = xmlPersistenceUnit(); + XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit(); // add property for testing XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties(); @@ -1059,20 +1059,20 @@ public class PersistenceUnitTests extends ContextModelTestCase public void testGetDefaultAccess() throws Exception { createOrmXmlFile(); - PersistenceUnit persistenceUnit = persistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.PROPERTY); assertEquals(AccessType.PROPERTY, persistenceUnit.getDefaultAccess()); - entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); + getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(AccessType.FIELD); assertEquals(AccessType.FIELD, persistenceUnit.getDefaultAccess()); } 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); } private ICompilationUnit createTestEntity() throws Exception { @@ -1122,34 +1122,34 @@ public class PersistenceUnitTests extends ContextModelTestCase } public void testPersistentType() throws Exception { - PersistenceUnit persistenceUnit = persistenceUnit(); + PersistenceUnit persistenceUnit = getPersistenceUnit(); createTestEntity(); //persistentType not listed in persistence.xml and discoverAnnotatedClasses is false //still find the persistentType because of changes for bug 190317 - assertFalse(jpaProject().discoversAnnotatedClasses()); + assertFalse(getJpaProject().discoversAnnotatedClasses()); assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME)); //test persistentType not listed in persistence.xml, discover annotated classes set to true - jpaProject().setDiscoversAnnotatedClasses(true); + getJpaProject().setDiscoversAnnotatedClasses(true); assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME)); //test persistentType list as class in persistence.xml - jpaProject().setDiscoversAnnotatedClasses(false); + getJpaProject().setDiscoversAnnotatedClasses(false); XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef(); classRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME); - xmlPersistenceUnit().getClasses().add(classRef); + getXmlPersistenceUnit().getClasses().add(classRef); assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME)); //test persistentType from orm.xml file that is specified in the persistence.xml createOrmXmlFile(); - OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); + OrmPersistentType ormPersistentType = getEntityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); assertNotNull(persistenceUnit.getPersistentType("model.Foo")); assertEquals(ormPersistentType, persistenceUnit.getPersistentType("model.Foo")); //test persistentType from orm.xml file that is implied(not specified) in the persistence.xml - xmlPersistenceUnit().getMappingFiles().remove(0); + getXmlPersistenceUnit().getMappingFiles().remove(0); assertNotNull(persistenceUnit.getPersistentType("model.Foo")); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java index 5e7c816754..991e733d5a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java @@ -26,7 +26,7 @@ public class PersistenceXmlTests extends ContextModelTestCase } public void testUpdateAddPersistence() throws Exception { - PersistenceResource prm = persistenceResource(); + PersistenceResource prm = getPersistenceResource(); prm.getContents().clear(); prm.save(null); @@ -39,7 +39,7 @@ public class PersistenceXmlTests extends ContextModelTestCase } public void testModifyAddPersistence() { - PersistenceResource prm = persistenceResource(); + PersistenceResource prm = getPersistenceResource(); prm.getContents().remove(prm.getPersistence()); assertNull(prm.getPersistence()); @@ -61,7 +61,7 @@ public class PersistenceXmlTests extends ContextModelTestCase } public void testUpdateRemovePersistence() throws Exception { - PersistenceResource prm = persistenceResource(); + PersistenceResource prm = getPersistenceResource(); assertNotNull(persistenceXml().getPersistence()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java index 6cf8b7ecd2..8582dccc39 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextNodeTests.java @@ -22,7 +22,7 @@ public class RootContextNodeTests extends ContextModelTestCase } public void testModifyAddPersistenceXml() throws Exception { - PersistenceResource pr = persistenceResource(); + PersistenceResource pr = getPersistenceResource(); deleteResource(pr); assertFalse(pr.exists()); @@ -67,7 +67,7 @@ public class RootContextNodeTests extends ContextModelTestCase } public void testUpdateAddPersistenceXml() throws Exception { - PersistenceResource pr = persistenceResource(); + PersistenceResource pr = getPersistenceResource(); deleteResource(pr); assertFalse(pr.exists()); @@ -81,7 +81,7 @@ public class RootContextNodeTests extends ContextModelTestCase } public void testUpdateRemovePersistenceXml() throws Exception { - PersistenceResource pr = persistenceResource(); + PersistenceResource pr = getPersistenceResource(); JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode(); assertNotNull(baseJpaContent.getPersistenceXml()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java index 81e2e71019..e338590b8a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JpaPlatformTests.java @@ -88,7 +88,7 @@ public class JpaPlatformTests extends ContextModelTestCase protected JpaPlatform jpaPlatform() { - return this.jpaProject().getJpaPlatform(); + return this.getJpaProject().getJpaPlatform(); } public void testJpaFactory() { @@ -99,10 +99,10 @@ public class JpaPlatformTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaTypeMapping javaTypeMapping = jpaProject().getJpaPlatform().buildJavaTypeMappingFromMappingKey(JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY, javaPersistentType()); + JavaTypeMapping javaTypeMapping = getJpaProject().getJpaPlatform().buildJavaTypeMappingFromMappingKey(JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY, getJavaPersistentType()); assertTrue(javaTypeMapping instanceof JavaTestTypeMapping); - javaTypeMapping = jpaPlatform().buildJavaTypeMappingFromMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY, javaPersistentType()); + javaTypeMapping = jpaPlatform().buildJavaTypeMappingFromMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType()); assertTrue(javaTypeMapping instanceof TestJavaEntity); } @@ -110,10 +110,10 @@ public class JpaPlatformTests extends ContextModelTestCase createTestEntity(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); - JavaAttributeMapping javaAttributeMapping = jpaProject().getJpaPlatform().buildJavaAttributeMappingFromMappingKey(JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY, javaPersistentType().getAttributeNamed("name")); + JavaAttributeMapping javaAttributeMapping = getJpaProject().getJpaPlatform().buildJavaAttributeMappingFromMappingKey(JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY, getJavaPersistentType().getAttributeNamed("name")); assertTrue(javaAttributeMapping instanceof JavaTestAttributeMapping); - javaAttributeMapping = jpaPlatform().buildJavaAttributeMappingFromMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentType().getAttributeNamed("name")); + javaAttributeMapping = jpaPlatform().buildJavaAttributeMappingFromMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, getJavaPersistentType().getAttributeNamed("name")); assertTrue(javaAttributeMapping instanceof TestJavaBasicMapping); } |