Package edu.drexel.goodwin.cpd.domain

Examples of edu.drexel.goodwin.cpd.domain.Researcher.merge()


      int beforeCount = result.size();
     
      // Delete someone and save
      Researcher firstResearcher = result.get(0);
      firstResearcher.setDeleted(true);
      firstResearcher.merge();
     
      // make sure the deleted researcher did not turn up in the search results
      result = Researcher.findResearchersBySkillsAndInterests(skills, interests, 0, 10);
      assertEquals(beforeCount - 1, result.size());
     
View Full Code Here


    int beforeCount = result.size();
   
    // Delete someone and save
    Researcher firstResearcher = result.get(0);
    firstResearcher.setDeleted(true);
    firstResearcher.merge();
   
    // make sure the deleted researcher did not turn up in the search results
    result = Researcher.findResearchersBySkillsAndInterests(skills, interests, 0, 10);
    assertEquals(beforeCount - 1, result.size());
  }
View Full Code Here

  @PreAuthorize("hasRole('ROLE_ADMIN')")
  @Override
  public void deleteResearcher(Long id) {
    Researcher researcher = Researcher.findResearcher(id);
    researcher.setDeleted(true);
    researcher.merge();
  }

  @PreAuthorize("hasRole('ROLE_ADMIN') or #id == principal.id")
  @Override
  public Researcher getResearcherForEditing(Long id) {
View Full Code Here

    }

    if (!result.hasErrors()) {
      uploadProfilePictureIfEntered(dto, researcher);

      researcher.merge();
      String message = generateMessage(accountUpdatedMessage, new Object[] {applicationUrl});
      messageSender.sendMessage("Community Profile Database Account Updated", researcher.getEmail(), message);
    }
  }
View Full Code Here

  @Override
  public void updatePassword(ResearcherDto dto, BindingResult result) {
    if (isPasswordValidAndMatchesConfirm(dto, result)) {
      Researcher researcher = getResearcherForEditing(dto.getId());
      researcher.setPassword(getHashedPassword(dto.getPassword(), researcher.getSalt()));
      researcher.merge();
    }
  }

  private String getHashedPassword(String rawPassword, String salt) {
    return passwordEncoder.encodePassword(rawPassword, salt);
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.