* {@inheritDoc}
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
SubMonitor progress = SubMonitor.convert(monitor, "Storing entities and associations", 100);
try {
// Always perform a schema update before storing the model
progress.setTaskName("Checking database schema ...");
IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(fDBUrl);
if (session.isOpen()) {
session.close();
Properties properties = EvolizerSessionHandler.getHandler().getProperties(fDBUrl);
EvolizerSessionHandler.getHandler().updateSchema(properties);
}
progress.worked(20);
progress.setTaskName("Deleting existing models of this project ...");
DAOModel queryModel= new DAOModel(fDBUrl);
List<FamixModel> existingModels = queryModel.queryStoredModels(fFamixModel.getName());
for (FamixModel famixModel : existingModels) {
DAOModel modelToDelete = new DAOModel(fDBUrl, famixModel);
modelToDelete.deleteModel();
}
progress.worked(20);
DAOModel newDAOModel = new DAOModel(fDBUrl, fFamixModel);
newDAOModel.store(progress.newChild(60));
} catch (EvolizerRuntimeException ere) {
sfLogger.error("Error storing FAMIX" , ere);
} catch (EvolizerException ee) {
sfLogger.error("Error storing FAMIX" , ee);
} finally {