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); }
public TagUI findById(String id) { return tMapper.toUIBean(tagRepo.findById(id)); }
public TagUI findByName(String name) { return tMapper.toUIBean(tagRepo.findByName(name)); }
public Page<TagUI> findAll(Pageable pageable) { return tMapper.toUIBean(tagRepo.findAll(pageable), pageable); }
public List<TagUI> findAll() { return tMapper.toUIBean(tagRepo.findAll()); }