public Result findRole(String roleId) { Result r = new Result(); if (!loggedIn) { r = r.notAuthorized(); return r; } Role role = new Role(); String selectRoleSql = "SELECT * FROM " + Role.AUX_ROLE + " WHERE " + "ID = " + roleId + " "; r = db.executeSingleSelectQuery(selectRoleSql, role); if (!role.isValid()) { r.error("User object not valid."); } else { if (r.isSuccessful()) { r.objectValue(role); } } return r; }
@Override public Result findUser(String userId) { Result r = new Result(); if (!loggedIn) { r = r.notAuthorized(); return r; } User user = new User(); String selectUserSql = "SELECT * FROM " + User.AUX_USER + " WHERE " + "ID = " + userId + " "; r = db.executeSingleSelectQuery(selectUserSql, user); if (!user.isValid()) { r.error("User object not valid."); } else { if (r.isSuccessful()) { r.objectValue(user); } } return r; }