Examples of save()


Examples of models.Photo.save()

        User user = User.filter("_id", new ObjectId(userId)).first();
        // 存储到数据库
        Marker marker = Marker.filter("_id", new ObjectId(markerId)).first();
        if (marker != null && user != null) {
            Photo photo = new Photo(marker, fileName);
            photo.save();
            // 存储文件
            File file = new File(FileUtils.getApplicationPath("data") + fileName);
            Images.resize(Filedata, file, -1, 550);
            Filedata.delete();
        } else {
View Full Code Here

Examples of models.PlayVersion.save()

        }
        else
        {
            PlayVersion playVersion = form.get();
            playVersion.majorVersion = getMajorVersion(playVersion);
            playVersion.save();
            result = redirect(routes.PlayVersions.showPlayVersions());
        }
        return result;
    }
   
View Full Code Here

Examples of models.PostcodeUnit.save()

                throw Throwables.propagate(e);
            }

            final TimerContext saveCtx = savePostcodeUnit.time();
            try {
                unit.save();

                postcodesProcessed.inc();
            } catch (MongoException.DuplicateKey e) {
                // ignore
            } finally {
View Full Code Here

Examples of models.Project.save()

        // Given
        String userName = "wansoon";
        String projectName = "test";
        Project project = createProject(userName, projectName);
        project.save();

        String email = "test@email.com";
        String wcPath = GitRepository.getRepoPrefix() + userName + "/" + "clone-" + projectName + ".git";
        String repoPath = wcPath + "/.git";
        String dirName = "dir";
View Full Code Here

Examples of models.Proposal.save()

        Form<Proposal> submittedForm = proposalForm.bindFromRequest();
        if(submittedForm.hasErrors()) {
            return ok(views.html.newProposal.render(submittedForm));
        } else {
            Proposal proposal = submittedForm.get();
            proposal.save();
            flash("message", "Thanks for submitting a proposal");
            return redirect(routes.Application.index());
        }
    }
View Full Code Here

Examples of models.PushedBranch.save()

        User currentUser = User.findByLoginId("admin");
        Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
        PullRequest pullRequest = PullRequest.findOne(project, pullRequestNumber);
        PushedBranch pushedBranch = new PushedBranch(new Date(), pullRequest.fromBranch,
                pullRequest.fromProject);
        pushedBranch.save();

        // When
        Result result = callAction(
                controllers.routes.ref.PullRequestApp.open(ownerLoginId, projectName, pullRequestNumber),
                fakeRequest("GET", "/" + ownerLoginId + "/" + projectName + "/pullRequest/" + pullRequestNumber)
View Full Code Here

Examples of models.SearchHistory.save()

  protected void saveSearchHistory(String searchTerm) {
    if (StringUtils.isNotBlank(searchTerm)) {
      SearchHistory s = new SearchHistory();
      s.date = new Date();
      s.searchTerm = searchTerm;
      s.save();
    } else {
      Logger.warn("Cannot save search history for invalid term: %s", searchTerm);
    }
  }
}
View Full Code Here

Examples of models.SecurityRole.save()

    if (SecurityRole.find.findRowCount() == 0) {
      for (final String roleName : Arrays
          .asList(controllers.Application.USER_ROLE)) {
        final SecurityRole role = new SecurityRole();
        role.roleName = roleName;
        role.save();
      }
    }
  }
}
View Full Code Here

Examples of models.Session.save()

                final int nbComments = Dummy.randomInt(2*averageCommentsPerMember);
                for (int i = 0; i < nbComments; i++) {
                    Session s = sessions.get(Dummy.randomInt(sessions.size()));
                    s.addComment(new SessionComment(m, s, Dummy.randomText(3000)));
                    s.save();
                }
            }
        }
    }
   
View Full Code Here

Examples of models.Staff.save()

        Staff staff = Staff.all().first();
        // Non activity for staff
        assertNull(Activity.find("select a from Activity a where a.member = ?", staff).first());

        staff.setTicketingRegistered(false);
        staff.save();
        // Still no activity for staff
        assertNull(Activity.find("select a from Activity a where a.member = ?", staff).first());

        staff.setTicketingRegistered(true);
        staff.save();
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.