Fix delete issue removing in hsql. History is now removed in advance.

This commit is contained in:
Paulo Gustavo Veiga 2013-01-26 00:52:05 -03:00
parent 8b0465bda6
commit 37419cba66

View File

@ -203,6 +203,13 @@ public class MindmapManagerImpl
@Override
public void removeMindmap(@NotNull final Mindmap mindMap) {
// Delete history first ...
final Criteria hibernateCriteria = getSession().createCriteria(MindMapHistory.class);
hibernateCriteria.add(Restrictions.eq("mindmapId", mindMap.getId()));
List list = hibernateCriteria.list();
getHibernateTemplate().deleteAll(list);
// Delete mindmap ....
getHibernateTemplate().delete(mindMap);
}