예제 #1
0
  @Transactional
  public void update(Author author) {
    author = this.findById(author.getId());

    author.setFirstName(author.getFirstName());
    author.setLastName(author.getLastName());

    authorRepository.saveAndFlush(author);
  }
예제 #2
0
 @Transactional
 public void updatePassword(Author author) {
   author.setPassword(passwordEncoder.encode(author.getPassword()));
   authorRepository.saveAndFlush(author);
 }
예제 #3
0
 public Author findByUsername(String username) {
   return authorRepository.findByUsername(username);
 }
예제 #4
0
 public List<Post> findAuthorPosts(Long id) {
   return postRepository.findByAuthor(authorRepository.findOne(id));
 }
예제 #5
0
 public Author findById(Long id) {
   return authorRepository.findOne(id);
 }
예제 #6
0
 public List<Author> find() {
   return authorRepository.findAll();
 }
예제 #7
0
 @Transactional
 public void delete(Long id) {
   authorRepository.delete(id);
 }