예제 #1
0
  public TagUI create(TagUI uiBean, Principal principal) {
    Tag newTag = tMapper.toPersistenceBean(uiBean);

    User user = userRepo.findByUserName(principal.getName());
    if (user != null) {
      newTag.setCreatedBy(user);
    }
    newTag.setCreatedDate(Calendar.getInstance().getTime());

    newTag = tagRepo.save(newTag);

    logger.debug(newTag);
    return tMapper.toUIBean(newTag);
  }
예제 #2
0
 public TagUI findById(String id) {
   return tMapper.toUIBean(tagRepo.findById(id));
 }
예제 #3
0
 public TagUI findByName(String name) {
   return tMapper.toUIBean(tagRepo.findByName(name));
 }
예제 #4
0
 public Page<TagUI> findAll(Pageable pageable) {
   return tMapper.toUIBean(tagRepo.findAll(pageable), pageable);
 }
예제 #5
0
 public List<TagUI> findAll() {
   return tMapper.toUIBean(tagRepo.findAll());
 }