From ed3b512a071fe5e6b31f626ff5f294382f4926cd Mon Sep 17 00:00:00 2001 From: Sasha Sherstnev Date: Wed, 18 Dec 2013 11:22:04 +0000 Subject: [PATCH] Fix problem with the registration form --- datadb/compbio/cassandra/CassandraUserManager.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/datadb/compbio/cassandra/CassandraUserManager.java b/datadb/compbio/cassandra/CassandraUserManager.java index 4bcd4b9..e2158f7 100644 --- a/datadb/compbio/cassandra/CassandraUserManager.java +++ b/datadb/compbio/cassandra/CassandraUserManager.java @@ -58,13 +58,13 @@ public class CassandraUserManager implements UserManager { try { ResultSet values = session.execute(com); List list = values.all(); - /* - if (1 != list.size()) { - return false; + if (0 < list.size()) { + String test = list.get(0).getString("Value"); + id = Long.parseLong(test, 10); + } else { + // if the MaxUserId parameter does not exist it is inserted with id = 1 + id = 0; } - */ - String test = list.get(0).getString("Value"); - id = Long.parseLong(test, 10); id++; com = "INSERT INTO MainParameters (name,value) VALUES ('MaxUserId','" + id + "');"; session.execute(com); @@ -82,7 +82,7 @@ public class CassandraUserManager implements UserManager { return false; } } - + String incom = "INSERT INTO Users (name, id, email, password, organisation, position, signedtolist, registrationdate) VALUES ('" + user.getFullName() + "'," + id + ",'" + user.getEmail() + "','" + user.getPassword() + "','" + user.getOrganisation() + "','" + user.getPosition() + "'," + user.isUpdateByEmail() + "," -- 1.7.10.2