package net.sevecek.dailyplanet;

import java.util.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.jdbc.core.*;
import org.springframework.stereotype.*;
import org.springframework.transaction.annotation.*;

@Repository
@Transactional
public class AutorRepository {

    @Autowired
    private JdbcTemplate pokladacDotazu;

    @Autowired
    @Qualifier("prevodnikTridyAutor")
    private RowMapper<Autor> prevodnikTridyAutor;

    public List<Autor> findAll() {
        List<Autor> seznamAutoru = pokladacDotazu.query(
                "select Autor_id as autorId, KrestniJmeno, Prijmeni, Email, Telefon "
                        + " from Autor",
                prevodnikTridyAutor);
        return seznamAutoru;
    }

}
