@@ -0,0 +1,985 @@
+package cz.muni.fi.pa165.dao;%0A%0Aimport java.util.List;%0A%0Aimport javax.persistence.EntityManager;%0Aimport javax.persistence.PersistenceUnit;%0A%0Aimport org.springframework.stereotype.Repository;%0Aimport org.springframework.transaction.annotation.Transactional;%0A%0Aimport cz.muni.fi.pa165.entity.Loan;%0A%0A/**%0A * Data access object for Loan entity%0A *%0A * @author Michael Simacek%0A *%0A */%0A@Transactional%0A@Repository%0Apublic class LoanDaoImpl implements LoanDao %7B%0A    @PersistenceUnit%0A    private EntityManager em;%0A%0A    @Override%0A    public void create(Loan loan) %7B%0A        em.persist(loan);%0A    %7D%0A%0A    @Override%0A    public Loan findById(Long id) %7B%0A        return em.find(Loan.class, id);%0A    %7D%0A%0A    @Override%0A    public List%3CLoan%3E findAll() %7B%0A        return em.createQuery(%22from Loan%22, Loan.class).getResultList();%0A    %7D%0A%0A    @Override%0A    public void delete(Loan loan) %7B%0A        em.remove(findById(loan.getId());%0A    %7D%0A%0A    @Override%0A    public void update(Loan loan) %7B%0A        em.merge(loan);%0A    %7D%0A%0A%7D%0A

Add implementation for LoanDao