EOModel prototypesModel = null;
Enumeration modelsEnum = modelGroup.models().objectEnumerator();
while (modelsEnum.hasMoreElements()) {
EOModel model = (EOModel) modelsEnum.nextElement();
EOEntity eoAdaptorPrototypesEntity = _modelGroup.entityNamed("EO" + model.adaptorName() + "Prototypes");
if (eoAdaptorPrototypesEntity != null) {
prototypesModel = eoAdaptorPrototypesEntity.model();
// System.out.println("EOFSQLGenerator.EOFSQLGenerator:
// removing " + eoAdaptorPrototypesEntity.name() + " from "
// + prototypesModel.name());
prototypesModel.removeEntity(eoAdaptorPrototypesEntity);
removedPrototypeEntities.takeValueForKey(eoAdaptorPrototypesEntity, eoAdaptorPrototypesEntity.name());
}
}
EOEntity eoPrototypesEntity = _modelGroup.entityNamed("EOPrototypes");
if (eoPrototypesEntity != null) {
prototypesModel = eoPrototypesEntity.model();
prototypesModel.removeEntity(eoPrototypesEntity);
// System.out.println("EOFSQLGenerator.EOFSQLGenerator: removing
// " + eoPrototypesEntity.name() + " from " +
// prototypesModel.name());
removedPrototypeEntities.takeValueForKey(eoPrototypesEntity, eoPrototypesEntity.name());
}
EOEntity prototypesEntity = _modelGroup.entityNamed(prototypeEntityName);
if (prototypesEntity == null) {
prototypesEntity = (EOEntity) removedPrototypeEntities.valueForKey(prototypeEntityName);
} else {
prototypesModel = prototypesEntity.model();
prototypesModel.removeEntity(prototypesEntity);
}
if (prototypesEntity != null && prototypesModel != null) {
// System.out.println("EOFSQLGenerator.EOFSQLGenerator: setting
// " + prototypesEntity.name() + " to EOPrototypes in " +
// prototypesModel.name());
prototypesEntity.setName(replacementPrototypeName);
prototypesModel.addEntity(prototypesEntity);
}
Enumeration resetModelsEnum = _modelGroup.models().objectEnumerator();
while (resetModelsEnum.hasMoreElements()) {