}
progress.worked(10);
Set<AbstractFamixEntity> keys = entityAssocaitionMap.keySet();
IEvolizerSession lSession = null;
try {
sLogger.debug("Storing all Famix-Entities");
progress.setTaskName("Storing FAMIX entities");
lSession = EvolizerSessionHandler.getHandler().getCurrentSession(fDBUrl);
lSession.startTransaction();
for (AbstractFamixEntity element : keys) {
sLogger.debug("Adding to database " + element.getClass().getName() + ":\n" + element.getUniqueName());
lSession.saveObject(element);
}
lSession.flush();
lSession.clear();
sLogger.debug("Famix-Entities storage complete");
progress.worked(45);
sLogger.debug("Storing all Associstions");
progress.setTaskName("Storing FAMIX associations");
for (AbstractFamixEntity element : keys) {
for (FamixAssociation association : entityAssocaitionMap.get(element)) {
if ((association.getFrom().getId() != null) && (association.getTo().getId() != null)) {
sLogger.debug("Adding to database " + association.getClass().getName() + ":\n" + "FROM "
+ association.getFrom().getUniqueName() + " TO " + association.getTo().getUniqueName());
// fSession.saveObject(association);
lSession.saveObject(association);
} else {
sLogger.warn("Missing ID in " + association.getType() + " association of entitye "
+ element.getUniqueName() + "(" + element.getId() + ")");
}
}
lSession.flush();
lSession.clear();
}
sLogger.debug("Associations storage complete");
lSession.saveObject(fModel);
lSession.flush();
lSession.clear();
sLogger.debug("Model entry stored");
progress.worked(45);
} catch (EvolizerException e) {
throw new EvolizerException(e);
} finally {
if (lSession != null) {
lSession.endTransaction();
}
}
}