Support for Java 11

This commit is contained in:
Paulo Gustavo Veiga
2020-11-06 21:35:54 -08:00
parent 542c0c33e0
commit ad9cea069a
45 changed files with 240 additions and 232 deletions

View File

@@ -24,20 +24,20 @@ public class LabelManagerImpl extends HibernateDaoSupport
@NotNull
@Override
public List<Label> getAllLabels(@NotNull final User user) {
return getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
return (List<Label>) getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
}
@Nullable
@Override
public Label getLabelById(int id, @NotNull final User user) {
List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where id=? and creator=?", new Object[]{id, user});
List<Label> labels = (List<Label>) getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where id=? and creator=?", new Object[]{id, user});
return getFirst(labels);
}
@Nullable
@Override
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
final List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where title=? and creator=?", new Object[]{title, user});
final List<Label> labels = (List<Label>) getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where title=? and creator=?", new Object[]{title, user});
return getFirst(labels);
}

View File

@@ -40,7 +40,7 @@ public class MindmapManagerImpl
@Override
public Collaborator findCollaborator(@NotNull final String email) {
final Collaborator collaborator;
final List<Collaborator> collaborators = getHibernateTemplate().find("from com.wisemapping.model.Collaborator collaborator where email=?", email);
final List<Collaborator> collaborators = (List<Collaborator>) getHibernateTemplate().find("from com.wisemapping.model.Collaborator collaborator where email=?", email);
if (collaborators != null && !collaborators.isEmpty()) {
assert collaborators.size() == 1 : "More than one user with the same email!";
collaborator = collaborators.get(0);
@@ -154,19 +154,19 @@ public class MindmapManagerImpl
@Override
public List<Collaboration> findCollaboration(final long collaboratorId) {
return getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where colaborator_id=?", collaboratorId);
return (List<Collaboration>) getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where colaborator_id=?", collaboratorId);
}
@Override
public List<Collaboration> findCollaboration(final CollaborationRole collaborationRole) {
return getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where roleId=?", collaborationRole.ordinal());
return (List<Collaboration>) getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where roleId=?", collaborationRole.ordinal());
}
@Override
public Collaboration findCollaboration(final int mindmapId, final User user) {
final Collaboration result;
final List<Collaboration> mindMaps = getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where mindMap.id=? and colaborator_id=?", new Object[]{mindmapId, user.getId()});
final List<Collaboration> mindMaps = (List<Collaboration>) getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where mindMap.id=? and colaborator_id=?", new Object[]{mindmapId, user.getId()});
if (mindMaps != null && !mindMaps.isEmpty()) {
result = mindMaps.get(0);
} else {
@@ -194,7 +194,7 @@ public class MindmapManagerImpl
@Override
public List<Mindmap> getAllMindmaps() {
return getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping");
return (List<Mindmap>) getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping");
}
@Override
@@ -206,7 +206,7 @@ public class MindmapManagerImpl
@Override
public Mindmap getMindmapByTitle(final String title, final User user) {
final Mindmap result;
List<Mindmap> mindMaps = getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping where title=? and creator=?", new Object[]{title, user});
List<Mindmap> mindMaps = (List<Mindmap>) getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping where title=? and creator=?", new Object[]{title, user});
if (mindMaps != null && !mindMaps.isEmpty()) {
result = mindMaps.get(0);
} else {

View File

@@ -43,14 +43,14 @@ public class UserManagerImpl
}
public List<User> getAllUsers() {
return getHibernateTemplate().find("from com.wisemapping.model.User user");
return (List<User>) getHibernateTemplate().find("from com.wisemapping.model.User user");
}
@Override
public User getUserBy(@NotNull final String email) {
User user = null;
final List<User> users = getHibernateTemplate().find("from com.wisemapping.model.User colaborator where email=?", email);
final List<User> users = (List<User>) getHibernateTemplate().find("from com.wisemapping.model.User colaborator where email=?", email);
if (users != null && !users.isEmpty()) {
assert users.size() == 1 : "More than one user with the same email!";
user = users.get(0);