diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java index 57271f19..01012bc8 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/LabelManagerImpl.java @@ -80,7 +80,7 @@ public class LabelManagerImpl @Override public void removeLabel(@NotNull Label label) { - getSession().delete(label); + getSession().remove(label); } @Nullable diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java index 72e23ffa..646d403e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java @@ -117,13 +117,13 @@ public class MindmapManagerImpl @Override public void removeCollaboration(Collaboration collaboration) { final Session session = getSession(); - session.delete(collaboration); + session.remove(collaboration); } @Override public void removeCollaborator(@NotNull Collaborator collaborator) { final Session session = getSession(); - session.delete(collaborator); + session.remove(collaborator); } @Override @@ -164,7 +164,7 @@ public class MindmapManagerImpl @Override public void updateMindmap(@NotNull Mindmap mindMap, boolean saveHistory) { assert mindMap != null : "Save Mindmap: Mindmap is required!"; - getSession().saveOrUpdate(mindMap); + getSession().merge(mindMap); if (saveHistory) { saveHistory(mindMap); } @@ -186,7 +186,7 @@ public class MindmapManagerImpl mindmap.removedCollaboration(mindmap.getCollaborations()); // Delete mindmap .... - getSession().delete(mindmap); + getSession().remove(mindmap); } private void saveHistory(@NotNull final Mindmap mindMap) { @@ -196,6 +196,6 @@ public class MindmapManagerImpl history.setCreationTime(Calendar.getInstance()); history.setEditor(mindMap.getLastEditor()); history.setMindmapId(mindMap.getId()); - getSession().saveOrUpdate(history); + getSession().merge(history); } } diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java index bcb4fbee..c71d89f8 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/UserManagerImpl.java @@ -134,13 +134,13 @@ public class UserManagerImpl } // Delete old user ... - session.delete(collaborator); + session.remove(collaborator); return user; } @Override public void removeUser(@NotNull final User user) { - getSession().delete(user); + getSession().remove(user); } public void auditLogin(@NotNull AccessAuditory accessAuditory) { @@ -166,12 +166,12 @@ public class UserManagerImpl final SelectionQuery query = getSession().createSelectionQuery("from com.wisemapping.model.User user where " + "activationCode=:activationCode", User.class); query.setParameter("activationCode", code); - final List users = query.list(); + final List users = query.getResultList(); if (users != null && !users.isEmpty()) { assert users.size() == 1 : "More than one user with the same username!"; - user = (User) users.get(0); + user = users.get(0); } else { user = null; }