2 * In Samsung Ukraine R&D Center (SRK under a contract between)
3 * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
6 package com.samsung.samserver.service.impl;
8 import com.samsung.samserver.service.ReportService;
9 import com.samsung.samserver.domain.primary.Report;
10 import com.samsung.samserver.repository.primary.ReportRepository;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
13 import org.springframework.stereotype.Service;
14 import org.springframework.transaction.annotation.Transactional;
16 import java.util.List;
19 * Service Implementation for managing Report.
23 public class ReportServiceImpl implements ReportService {
25 private final Logger log = LoggerFactory.getLogger(ReportServiceImpl.class);
27 private final ReportRepository reportRepository;
29 public ReportServiceImpl(ReportRepository reportRepository) {
30 this.reportRepository = reportRepository;
36 * @param report the entity to save
37 * @return the persisted entity
40 public Report save(Report report) {
41 log.debug("Request to save Report : {}", report);
42 return reportRepository.save(report);
46 * Get all the reports.
48 * @return the list of entities
51 @Transactional(readOnly = true)
52 public List<Report> findAll() {
53 log.debug("Request to get all Reports"); //NOSONAR
54 return reportRepository.findAll();
58 * Get one report by id.
60 * @param id the id of the entity
64 @Transactional(readOnly = true)
65 public Report findOne(Long id) {
66 log.debug("Request to get Report : {}", id);
67 return reportRepository.findOne(id);
71 * Delete the report by id.
73 * @param id the id of the entity
76 public void delete(Long id) {
77 log.debug("Request to delete Report : {}", id);
78 reportRepository.delete(id);