Commit eccbcdd9 authored by Smejky338's avatar Smejky338
Browse files

Remove extend from ReportDao and add missing visibility to methods

parent 2ee1311e
Pipeline #122632 waiting for manual action with stage
package cz.fi.muni.pa165.seminar4.group7.secretservice.dao;
package java.cz.fi.muni.pa165.seminar4.group7.secretservice.dao;
import cz.fi.muni.pa165.seminar4.group7.secretservice.entity.Report;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
/**
* @author Jan Smejkal
*/
public interface ReportDao extends CrudRepository<Report, Long> {
public interface ReportDao {
void create(Report report);
List<Report> findAll();
......
package cz.fi.muni.pa165.seminar4.group7.secretservice.dao;
package java.cz.fi.muni.pa165.seminar4.group7.secretservice.dao;
import cz.fi.muni.pa165.seminar4.group7.secretservice.entity.Report;
import org.springframework.data.repository.CrudRepository;
......@@ -18,28 +18,27 @@ public class ReportDaoImpl implements ReportDao {
@PersistenceContext
private EntityManager em;
public AgentDaoImpl(EntityManager em) {
public ReportDaoImpl(EntityManager em) {
this.em = em;
}
@Override
void create(Report report) {
public void create(Report report) {
em.persist(report);
}
@Override
List<Report> findAll() {
public List<Report> findAll() {
return em.createQuery("select r from Report r", Report.class).getResultList();
}
@Override
Report findById(long id) {
return em.createQuery("select p from Product p where name = :name", Product.class)
.setParameter("name", name)
.getResultList();
public Report findById(long id) {
return em.find(Report.class, id);
}
@Override
void remove(Report report) {
public void remove(Report report) {
em.remove(report);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment