diff options
author | kmoore | 2008-04-23 18:31:27 +0000 |
---|---|---|
committer | kmoore | 2008-04-23 18:31:27 +0000 |
commit | f155832c07c7453346f3eb10095c1092a7254d76 (patch) | |
tree | 44d9219172de7bbf42c95240b130b4870084ac54 | |
parent | 24b2353e5cfb3a40af4b77315a2a98dea53c5945 (diff) | |
download | webtools.dali-f155832c07c7453346f3eb10095c1092a7254d76.tar.gz webtools.dali-f155832c07c7453346f3eb10095c1092a7254d76.tar.xz webtools.dali-f155832c07c7453346f3eb10095c1092a7254d76.zip |
228411 - remove entity from orm.xml source and another entity is removed as well
2 files changed, 31 insertions, 16 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java index fd8b4256e0..5a9a038de4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.core.internal.context.orm; import java.util.ArrayList; -import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; @@ -591,12 +590,13 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements this.updateEmbeddables(entityMappings, ormPersistentTypes); while (ormPersistentTypes.hasNext()) { - this.removeOrmPersistentType(ormPersistentTypes.next()); + this.removeOrmPersistentType_(ormPersistentTypes.next()); } } protected void updateMappedSuperclasses(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) { - for (XmlMappedSuperclass mappedSuperclass : Collections.unmodifiableCollection(entityMappings.getMappedSuperclasses())) {//prevent ConcurrentModificiationException + ListIterator<XmlMappedSuperclass> mappedSuperclasses = new CloneListIterator<XmlMappedSuperclass>(entityMappings.getMappedSuperclasses());//prevent ConcurrentModificiationException + for (XmlMappedSuperclass mappedSuperclass : CollectionTools.iterable(mappedSuperclasses)) { if (ormPersistentTypes.hasNext()) { ormPersistentTypes.next().update(mappedSuperclass); } @@ -609,7 +609,8 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements } protected void updateEntities(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) { - for (XmlEntity entity : Collections.unmodifiableCollection(entityMappings.getEntities())) {//prevent ConcurrentModificiationException + ListIterator<XmlEntity> entities = new CloneListIterator<XmlEntity>(entityMappings.getEntities());//prevent ConcurrentModificiationException + for (XmlEntity entity : CollectionTools.iterable(entities)) { if (ormPersistentTypes.hasNext()) { ormPersistentTypes.next().update(entity); } @@ -622,7 +623,8 @@ public class GenericEntityMappings extends AbstractOrmJpaContextNode implements } protected void updateEmbeddables(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) { - for (XmlEmbeddable embeddable : Collections.unmodifiableCollection(entityMappings.getEmbeddables())) {//prevent ConcurrentModificiationException + ListIterator<XmlEmbeddable> embeddables = new CloneListIterator<XmlEmbeddable>(entityMappings.getEmbeddables());//prevent ConcurrentModificiationException + for (XmlEmbeddable embeddable : CollectionTools.iterable(embeddables)) { if (ormPersistentTypes.hasNext()) { ormPersistentTypes.next().update(embeddable); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java index 8f5eccb231..0363781548 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java @@ -11,7 +11,6 @@ package org.eclipse.jpt.core.internal.context.orm; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; @@ -687,7 +686,8 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } protected void updateIds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlId id : Collections.unmodifiableCollection(attributes.getIds())) {//prevent ConcurrentModificiationException + ListIterator<XmlId> ids = new CloneListIterator<XmlId>(attributes.getIds());//prevent ConcurrentModificiationException + for (XmlId id : CollectionTools.iterable(ids)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(id); } @@ -700,7 +700,8 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } protected void updateEmbeddedIds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlEmbeddedId embeddedId : Collections.unmodifiableCollection(attributes.getEmbeddedIds())) {//prevent ConcurrentModificiationException + ListIterator<XmlEmbeddedId> embeddedIds = new CloneListIterator<XmlEmbeddedId>(attributes.getEmbeddedIds());//prevent ConcurrentModificiationException + for (XmlEmbeddedId embeddedId : CollectionTools.iterable(embeddedIds)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(embeddedId); } @@ -713,7 +714,8 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } protected void updateBasics(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlBasic basic : Collections.unmodifiableCollection(attributes.getBasics())) {//prevent ConcurrentModificiationException + ListIterator<XmlBasic> basics = new CloneListIterator<XmlBasic>(attributes.getBasics());//prevent ConcurrentModificiationException + for (XmlBasic basic : CollectionTools.iterable(basics)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(basic); } @@ -726,7 +728,8 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } protected void updateVersions(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlVersion version : Collections.unmodifiableCollection(attributes.getVersions())) {//prevent ConcurrentModificiationException + ListIterator<XmlVersion> versions = new CloneListIterator<XmlVersion>(attributes.getVersions());//prevent ConcurrentModificiationException + for (XmlVersion version : CollectionTools.iterable(versions)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(version); } @@ -737,8 +740,10 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } } } + protected void updateManyToOnes(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlManyToOne manyToOne : Collections.unmodifiableCollection(attributes.getManyToOnes())) {//prevent ConcurrentModificiationException + ListIterator<XmlManyToOne> manyToOnes = new CloneListIterator<XmlManyToOne>(attributes.getManyToOnes());//prevent ConcurrentModificiationException + for (XmlManyToOne manyToOne : CollectionTools.iterable(manyToOnes)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(manyToOne); } @@ -749,8 +754,10 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } } } + protected void updateOneToManys(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlOneToMany oneToMany : Collections.unmodifiableCollection(attributes.getOneToManys())) {//prevent ConcurrentModificiationException + ListIterator<XmlOneToMany> oneToManys = new CloneListIterator<XmlOneToMany>(attributes.getOneToManys());//prevent ConcurrentModificiationException + for (XmlOneToMany oneToMany : CollectionTools.iterable(oneToManys)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(oneToMany); } @@ -761,8 +768,10 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } } } + protected void updateOneToOnes(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlOneToOne oneToOne : Collections.unmodifiableCollection(attributes.getOneToOnes())) {//prevent ConcurrentModificiationException + ListIterator<XmlOneToOne> oneToOnes = new CloneListIterator<XmlOneToOne>(attributes.getOneToOnes());//prevent ConcurrentModificiationException + for (XmlOneToOne oneToOne : CollectionTools.iterable(oneToOnes)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(oneToOne); } @@ -773,8 +782,10 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } } } + protected void updateManyToManys(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlManyToMany manyToMany : Collections.unmodifiableCollection(attributes.getManyToManys())) {//prevent ConcurrentModificiationException + ListIterator<XmlManyToMany> manyToManys = new CloneListIterator<XmlManyToMany>(attributes.getManyToManys());//prevent ConcurrentModificiationException + for (XmlManyToMany manyToMany : CollectionTools.iterable(manyToManys)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(manyToMany); } @@ -787,7 +798,8 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } protected void updateEmbeddeds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlEmbedded embedded : Collections.unmodifiableCollection(attributes.getEmbeddeds())) {//prevent ConcurrentModificiationException + ListIterator<XmlEmbedded> embeddeds = new CloneListIterator<XmlEmbedded>(attributes.getEmbeddeds());//prevent ConcurrentModificiationException + for (XmlEmbedded embedded : CollectionTools.iterable(embeddeds)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(embedded); } @@ -800,7 +812,8 @@ public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implemen } protected void updateTransients(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) { - for (XmlTransient transientResource : Collections.unmodifiableCollection(attributes.getTransients())) {//prevent ConcurrentModificiationException + ListIterator<XmlTransient> transients = new CloneListIterator<XmlTransient>(attributes.getTransients());//prevent ConcurrentModificiationException + for (XmlTransient transientResource : CollectionTools.iterable(transients)) { if (ormPersistentAttributes.hasNext()) { ormPersistentAttributes.next().update(transientResource); } |