Package models

Examples of models.User.save()


    User userC = users.createDefaultInstance().setHandle("C").setBio("CEO").setNumPosts(2);
    User userD = users.createDefaultInstance().setHandle("D").setBio("Janitor").setNumPosts(3);
    userA.save();
    userB.save();
    userC.save();
    userD.save();

    Set<User> result;

    // an empty query should return an empty set
    result = users.query().find();
View Full Code Here


    User james = users.createDefaultInstance().setHandle("James").setBio("Surfer").setNumPosts(5).setCreatedAtMillis(3l).setSomeDatetime(1000000l);
    brad.save();
    brandon.save();
    casey.save();
    john.save();
    james.save();

    Set<User> result;

    // Equal To
    result = users.query().whereHandle(equalTo("Brad")).find();
View Full Code Here

    userC.save();
    userD.save();
    userE.save();
    userF.save();
    userG.save();
    userH.save();

    List<User> orderedResult1;
    List<User> orderedResult2;

    // An empty query should return an empty list.
View Full Code Here

    User userA = users.createDefaultInstance().setHandle("AAAA").setBio("Batman").setCreatedAtMillis(1L).setNumPosts(1);
    User userB = users.createDefaultInstance().setHandle("BBBB").setBio("Superman").setCreatedAtMillis(1L);
    User userC = users.createDefaultInstance().setHandle("CCCC").setBio("Spiderman").setCreatedAtMillis(1L);
    userA.save();
    userB.save();
    userC.save();

    Collection<User> result;

    result = users.query().select(User._Fields.handle)
        .whereBio(endsWith("man"))
View Full Code Here

    IUserPersistence users = dbs.getDatabase1().users();
    users.deleteAll();

    for (int i = 0; i < 100; i++) {
      User user = users.createDefaultInstance().setHandle(String.valueOf(i % 2)).setNumPosts(i);
      user.save();
    }

    List<User> result;

    // Test Max
View Full Code Here

        JsonNode userJson = request().body().asJson();
        user.setNotifOnMyProposal(userJson.get("notifOnMyProposal").asBoolean());
        user.setNotifAdminOnAllProposal(userJson.get("notifAdminOnAllProposal").asBoolean());
        user.setNotifAdminOnProposalWithComment(userJson.get("notifAdminOnProposalWithComment").asBoolean());
        user.save();
        return ok();
    }
}
View Full Code Here

            Link link = newLink.get();
            link.linkType =  newLinkType;
            user.getLinks().add(link);
        }

        user.save();

        return ok();
    }

View Full Code Here

            user.email = register.email;
            user.fullname = register.fullname;
            user.passwordHash = Hash.createPassword(register.inputPassword);
            user.confirmationToken = UUID.randomUUID().toString();

            user.save();
            sendMailAskForConfirmation(user);

            return ok(created.render());
        } catch (EmailException e) {
            Logger.debug("Signup.save Cannot send email", e);
View Full Code Here

            flash("error", Messages.get("error.expiredmaillink"));
            return badRequest(emailValidate.render(user));
        }

        user.email = resetToken.email;
        user.save();

        session("email", resetToken.email);

        flash("success", Messages.get("account.settings.email.successful", user.email));
View Full Code Here

    User familiar = User.findByUsername("basoko");
    if(familiar == null) {
      familiar = new User();
      familiar.username = "basoko";
      familiar.password = "12345";
      familiar.save();
    }
   
    User interned = User.findByUsername("david");
    if(interned == null) {
      interned = new 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.