diff options
author | bvosburgh | 2010-01-23 00:34:28 +0000 |
---|---|---|
committer | bvosburgh | 2010-01-23 00:34:28 +0000 |
commit | 859dc1b7628a8f00125a0d479835d2c9d0ef582b (patch) | |
tree | d565935ee0bf786331373899cb462166fab04160 /jpa/tests/org.eclipse.jpt.core.tests/src/org | |
parent | 7327d0313d3701351e82bcce8b39b4a95d7d15b0 (diff) | |
download | webtools.dali-859dc1b7628a8f00125a0d479835d2c9d0ef582b.tar.gz webtools.dali-859dc1b7628a8f00125a0d479835d2c9d0ef582b.tar.xz webtools.dali-859dc1b7628a8f00125a0d479835d2c9d0ef582b.zip |
[233567] clean up AnnotationContainer stuff
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.core.tests/src/org')
6 files changed, 97 insertions, 97 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java index f1d5b7acd9..885223329a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * Copyright (c) 2009, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -174,7 +174,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next(); + AssociationOverrideAnnotation associationOverride = associationOverrides.getNestedAnnotations().iterator().next(); assertNotNull(associationOverride); assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName()); @@ -185,7 +185,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next(); + AssociationOverrideAnnotation associationOverride = associationOverrides.getNestedAnnotations().iterator().next(); assertNotNull(associationOverride); assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName()); @@ -200,7 +200,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next(); + AssociationOverrideAnnotation associationOverride = associationOverrides.getNestedAnnotations().iterator().next(); assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName()); associationOverride.setName(null); @@ -419,7 +419,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { ICompilationUnit cu = this.createTestAssociationOverrideOnType(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation joinTable = associationOverride.getJoinTable(); assertNotNull(associationOverride); assertNull(joinTable); @@ -429,7 +429,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation joinTable = associationOverride.getJoinTable(); assertEquals(JOIN_TABLE_NAME, joinTable.getName()); } @@ -438,7 +438,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation joinTable = associationOverride.getJoinTable(); assertEquals(JOIN_TABLE_NAME, joinTable.getName()); @@ -455,7 +455,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { ICompilationUnit cu = this.createTestAssociationOverrideOnType(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation joinTable = associationOverride.getJoinTable(); assertNull(joinTable); @@ -469,7 +469,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { ICompilationUnit cu = this.createTestAssociationOverrideOnType(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation joinTable = associationOverride.getJoinTable(); assertNull(joinTable); } @@ -479,7 +479,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertNotNull(table); assertEquals(CATALOG_NAME, table.getCatalog()); @@ -490,7 +490,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertNotNull(table); assertNull(table.getCatalog()); @@ -506,7 +506,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(CATALOG_NAME, table.getCatalog()); @@ -521,7 +521,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertNotNull(table); assertEquals(SCHEMA_NAME, table.getSchema()); @@ -532,7 +532,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertNotNull(table); assertNull(table.getSchema()); @@ -548,7 +548,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(SCHEMA_NAME, table.getSchema()); @@ -563,7 +563,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(0, table.uniqueConstraintsSize()); @@ -574,7 +574,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); @@ -589,7 +589,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(3, table.uniqueConstraintsSize()); @@ -600,7 +600,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addUniqueConstraint(0).addColumnName("FOO"); @@ -619,7 +619,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals("BAR", table.uniqueConstraintAt(0).columnNames().next()); assertEquals("FOO", table.uniqueConstraintAt(1).columnNames().next()); @@ -647,7 +647,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu); @@ -660,7 +660,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu); @@ -673,7 +673,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(0, table.joinColumnsSize()); @@ -684,7 +684,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); @@ -699,7 +699,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(2, table.joinColumnsSize()); @@ -710,7 +710,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addJoinColumn(0).setName("FOO"); @@ -728,7 +728,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addJoinColumn(0).setName("FOO"); @@ -759,7 +759,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); JoinColumnAnnotation joinColumn = table.joinColumnAt(0); joinColumn.setReferencedColumnName("REF_NAME"); @@ -786,7 +786,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); JoinColumnAnnotation joinColumn = table.joinColumnAt(0); @@ -816,7 +816,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(2, table.joinColumnsSize()); @@ -836,7 +836,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(0, table.inverseJoinColumnsSize()); @@ -847,7 +847,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); @@ -862,7 +862,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(2, table.inverseJoinColumnsSize()); @@ -873,7 +873,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addInverseJoinColumn(0).setName("FOO"); @@ -891,7 +891,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addInverseJoinColumn(2).setName("FOO"); @@ -923,7 +923,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addInverseJoinColumn(0).setName("FOO"); @@ -946,7 +946,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); table.addInverseJoinColumn(1).setName("FOO"); @@ -969,7 +969,7 @@ public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.nestedAnnotations().next(); + AssociationOverride2_0Annotation associationOverride = (AssociationOverride2_0Annotation) associationOverrides.getNestedAnnotations().iterator().next(); JoinTableAnnotation table = associationOverride.getJoinTable(); assertEquals(2, table.inverseJoinColumnsSize()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java index 9f1385dc63..c691286562 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * Copyright (c) 2007, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -77,7 +77,7 @@ public class AssociationOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next(); + AssociationOverrideAnnotation associationOverride = associationOverrides.getNestedAnnotations().iterator().next(); assertNotNull(associationOverride); assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName()); @@ -88,7 +88,7 @@ public class AssociationOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next(); + AssociationOverrideAnnotation associationOverride = associationOverrides.getNestedAnnotations().iterator().next(); assertNotNull(associationOverride); assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName()); @@ -103,7 +103,7 @@ public class AssociationOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AssociationOverridesAnnotation associationOverrides = (AssociationOverridesAnnotation) attributeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDES); - AssociationOverrideAnnotation associationOverride = associationOverrides.nestedAnnotations().next(); + AssociationOverrideAnnotation associationOverride = associationOverrides.getNestedAnnotations().iterator().next(); assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName()); associationOverride.setName(null); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java index 6ff234c926..d0cd7228d9 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * Copyright (c) 2007, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -78,7 +78,7 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getAnnotation(JPA.ATTRIBUTE_OVERRIDES); - AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next(); + AttributeOverrideAnnotation attributeOverride = attributeOverrides.getNestedAnnotations().iterator().next(); assertNotNull(attributeOverride); assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName()); @@ -89,7 +89,7 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getAnnotation(JPA.ATTRIBUTE_OVERRIDES); - AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next(); + AttributeOverrideAnnotation attributeOverride = attributeOverrides.getNestedAnnotations().iterator().next(); ColumnAnnotation column = attributeOverride.getColumn(); assertNotNull(attributeOverride); assertNull(column); @@ -100,7 +100,7 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getAnnotation(JPA.ATTRIBUTE_OVERRIDES); - AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next(); + AttributeOverrideAnnotation attributeOverride = attributeOverrides.getNestedAnnotations().iterator().next(); assertNotNull(attributeOverride); assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName()); @@ -115,7 +115,7 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getAnnotation(JPA.ATTRIBUTE_OVERRIDES); - AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next(); + AttributeOverrideAnnotation attributeOverride = attributeOverrides.getNestedAnnotations().iterator().next(); assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName()); attributeOverride.setName(null); @@ -131,7 +131,7 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); JavaResourcePersistentAttribute attributeResource = typeResource.fields().next(); AttributeOverridesAnnotation attributeOverrides = (AttributeOverridesAnnotation) attributeResource.getAnnotation(JPA.ATTRIBUTE_OVERRIDES); - AttributeOverrideAnnotation attributeOverride = attributeOverrides.nestedAnnotations().next(); + AttributeOverrideAnnotation attributeOverride = attributeOverrides.getNestedAnnotations().iterator().next(); ColumnAnnotation column = attributeOverride.getColumn(); assertEquals(COLUMN_NAME, column.getName()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java index b18a3bed9e..d793d1c669 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * Copyright (c) 2007, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -115,7 +115,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertNotNull(namedQuery); } @@ -124,7 +124,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_NAME, namedQuery.getName()); } @@ -133,7 +133,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_NAME, namedQuery.getName()); namedQuery.setName("foo"); @@ -152,7 +152,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_QUERY, namedQuery.getQuery()); } @@ -161,7 +161,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_QUERY, namedQuery.getQuery()); namedQuery.setQuery("foo"); @@ -180,7 +180,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass()); } @@ -189,7 +189,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass()); namedQuery.setResultClass("foo"); @@ -208,7 +208,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertNotNull(namedQuery.getResultClass()); assertEquals("Result", namedQuery.getFullyQualifiedResultClassName());//bug 196200 changed this @@ -223,7 +223,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping()); } @@ -232,7 +232,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping()); namedQuery.setResultSetMapping("foo"); @@ -251,7 +251,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(0, namedQuery.hintsSize()); } @@ -261,7 +261,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0); namedQuery.addHint(1); @@ -274,7 +274,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); assertEquals(2, namedQuery.hintsSize()); } @@ -284,7 +284,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("FOO"); namedQuery.addHint(1); @@ -301,7 +301,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("BAZ"); assertEquals("BAZ", namedQuery.hintAt(0).getName()); @@ -331,7 +331,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("BAZ"); @@ -354,7 +354,7 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedNativeQueriesAnnotation namedQueries = (NamedNativeQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_NATIVE_QUERIES); - NamedNativeQueryAnnotation namedQuery = namedQueries.nestedAnnotations().next(); + NamedNativeQueryAnnotation namedQuery = namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("BAZ"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java index 6cdbdc802f..bbb61bb30b 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * Copyright (c) 2007, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -96,7 +96,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertNotNull(namedQuery); } @@ -105,7 +105,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_NAME, namedQuery.getName()); } @@ -114,7 +114,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_NAME, namedQuery.getName()); namedQuery.setName("foo"); @@ -133,7 +133,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_QUERY, namedQuery.getQuery()); } @@ -142,7 +142,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertEquals(QUERY_QUERY, namedQuery.getQuery()); namedQuery.setQuery("foo"); @@ -161,7 +161,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertEquals(0, namedQuery.hintsSize()); } @@ -171,7 +171,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0); namedQuery.addHint(1); @@ -184,7 +184,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); assertEquals(2, namedQuery.hintsSize()); } @@ -194,7 +194,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("FOO"); namedQuery.addHint(1); @@ -212,7 +212,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("BAZ"); assertEquals("BAZ", namedQuery.hintAt(0).getName()); @@ -241,7 +241,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("BAZ"); assertEquals("BAZ", namedQuery.hintAt(0).getName()); @@ -263,7 +263,7 @@ public class NamedQueriesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); NamedQueriesAnnotation namedQueries = (NamedQueriesAnnotation) typeResource.getAnnotation(JPA.NAMED_QUERIES); - NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.nestedAnnotations().next(); + NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) namedQueries.getNestedAnnotations().iterator().next(); namedQuery.addHint(0).setName("BAZ"); assertEquals("BAZ", namedQuery.hintAt(0).getName()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java index 1cc9a47435..1f62663fb9 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * Copyright (c) 2007, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -134,7 +134,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); assertNotNull(secondaryTables); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(TABLE_NAME, secondaryTable.getName()); } @@ -143,7 +143,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertNull(secondaryTable.getName()); assertNull(secondaryTable.getCatalog()); assertNull(secondaryTable.getSchema()); @@ -154,7 +154,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertNull(secondaryTable.getName()); @@ -169,7 +169,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(TABLE_NAME, secondaryTable.getName()); secondaryTable.setName(null); @@ -183,7 +183,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(CATALOG_NAME, secondaryTable.getCatalog()); } @@ -192,7 +192,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertNull(secondaryTable.getCatalog()); secondaryTable.setCatalog("Foo"); @@ -206,7 +206,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(CATALOG_NAME, secondaryTable.getCatalog()); secondaryTable.setCatalog(null); @@ -220,7 +220,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertNotNull(secondaryTable); assertEquals(SCHEMA_NAME, secondaryTable.getSchema()); } @@ -230,7 +230,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertNull(secondaryTable.getSchema()); secondaryTable.setSchema("Foo"); @@ -244,7 +244,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(SCHEMA_NAME, secondaryTable.getSchema()); secondaryTable.setSchema(null); @@ -258,7 +258,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTables(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(0, secondaryTable.uniqueConstraintsSize()); } @@ -267,7 +267,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTables(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); secondaryTable.addUniqueConstraint(0); secondaryTable.addUniqueConstraint(1); @@ -279,7 +279,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); assertEquals(2, secondaryTable.uniqueConstraintsSize()); } @@ -288,7 +288,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTables(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); secondaryTable.addUniqueConstraint(0).addColumnName("FOO"); secondaryTable.addUniqueConstraint(1); @@ -305,7 +305,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); secondaryTable.addUniqueConstraint(0).addColumnName("FOO"); secondaryTable.removeUniqueConstraint(2); @@ -322,7 +322,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); secondaryTable.addUniqueConstraint(0).addColumnName("FOO"); assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNames().next()); @@ -340,7 +340,7 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase { ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints(); JavaResourcePersistentType typeResource = buildJavaTypeResource(cu); SecondaryTablesAnnotation secondaryTables = (SecondaryTablesAnnotation) typeResource.getAnnotation(JPA.SECONDARY_TABLES); - SecondaryTableAnnotation secondaryTable = secondaryTables.nestedAnnotations().next(); + SecondaryTableAnnotation secondaryTable = secondaryTables.getNestedAnnotations().iterator().next(); secondaryTable.addUniqueConstraint(0).addColumnName("FOO"); assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNames().next()); |