Package models

Examples of models.User.save()


    User interned = User.findByUsername("david");
    if(interned == null) {
      interned = new User();
      interned.username = "david";
      interned.password = "12345";
      interned.save();
    }

    render("residences/admin/index.html");
  }
}
View Full Code Here



      newUser.setUsername(user);
      newUser.setPassword(pass);
                        newUser.setMail(mail);
                        newUser.save();

      response.sendRedirect(request.getContextPath());
    }
    }
        } catch (Exception e) {
View Full Code Here

       
        user.setUsername(request.getParameter("newUsername"));
        user.setPassword(request.getParameter("newPassword"));
                                user.setMail(request.getParameter("newMail"));
                                user.save();
      }
          }
                        else if(servletPath.equals("/admin/users/update")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {
View Full Code Here

      final OAuth.Response response = twitter.retrieveRequestToken();
      if (response.error==null) {
        final User user = new User();
        user.token = response.token;
        user.secret = response.secret;
        user.save();
        session.put("userId", user.id);
        redirect(twitter.redirectUrl(response.token));
      } else {
              Logger.error("Error contacting twitter: " + response.error);
              login();
View Full Code Here

                    Logger.error("Twitter authentication error: %s", twitterUser.get("error"));
                    login();
        }
        user.name = twitterUser.get("name").getAsString();
        user.avatarUrl = twitterUser.get("profile_image_url").getAsString();
        user.save();
        session.put(USER_COOKIE, user.id);
      }
      Application.list();
    }
  }
View Full Code Here

                user.accessToken = response.accessToken;
            }
            JsonObject me = WS.url("https://graph.facebook.com/me?fields=name,picture&access_token=%s", WS.encode(user.accessToken)).get().getJson().getAsJsonObject();
            user.name = me.get("name").getAsString();
            user.avatarUrl = me.get("picture").getAsString();
            user.save();
            session.put(USER_COOKIE, user.id);

            Application.list();
        }
        FACEBOOK.retrieveVerificationCode(authUrl);
View Full Code Here

                vote.playModule = module;
                vote.voteType = Vote.VoteType.UP;
                // support for public voting comes later
                vote.publicVote = false;
                user.votes.add(vote);
                user.save();

                ++module.upVoteCount;
                module.save();
            }
View Full Code Here

                vote.playModule = module;
                vote.voteType = Vote.VoteType.DOWN;
                // support for public voting comes later
                vote.publicVote = false;
                user.votes.add(vote);
                user.save();

                ++module.downVoteCount;
                module.save();
            }
View Full Code Here

                    rate.rating = ratingForm.rating;
                    module.rating.add(rate);
                    module.rating.calculateAverage();

                    module.save();
                    user.save();
                }

                RatingResponseForm responseForm = new RatingResponseForm();
                responseForm.totalRatings = module.rating.totalRatings();
                responseForm.averageRating = module.rating.averageRating;
View Full Code Here

        user.displayName = displayName;
        user.password = password;
        user.accountActive = true;
        user.roles = new ArrayList<UserRole>(roles);
        user.rates = new ArrayList<Rate>();
        user.save();
        user.saveManyToManyAssociations("roles");
        return user;
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.