java/SpringDemo1/SpringDemo1-ejb/src/java/cz/frantovo/springDemo1/dao/KnihaRowMapper.java
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/SpringDemo1/SpringDemo1-ejb/src/java/cz/frantovo/springDemo1/dao/KnihaRowMapper.java Wed Feb 10 21:23:45 2010 +0100
1.3 @@ -0,0 +1,24 @@
1.4 +package cz.frantovo.springDemo1.dao;
1.5 +
1.6 +import cz.frantovo.springDemo1.dto.Kniha;
1.7 +import java.sql.ResultSet;
1.8 +import java.sql.SQLException;
1.9 +import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
1.10 +
1.11 +/**
1.12 + *
1.13 + * @author fiki
1.14 + */
1.15 +public class KnihaRowMapper implements ParameterizedRowMapper<Kniha> {
1.16 +
1.17 + public Kniha mapRow(ResultSet rs, int i) throws SQLException {
1.18 + Kniha k = new Kniha();
1.19 + k.setNazev(rs.getString("nazev"));
1.20 + k.setAutor(rs.getInt("autor"));
1.21 + k.setDatumAktualizace(rs.getDate("datum"));
1.22 + k.setId(rs.getInt("id"));
1.23 + k.setPocetStran(rs.getInt("pocet_stran"));
1.24 + k.setRokVydani(rs.getInt("rok_vydani"));
1.25 + return k;
1.26 + }
1.27 +}