org.satic.persistence.pojo.DAO.rowMapper.ContenidoRowMapper.java Source code

Java tutorial

Introduction

Here is the source code for org.satic.persistence.pojo.DAO.rowMapper.ContenidoRowMapper.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.satic.persistence.pojo.DAO.rowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.satic.persistence.pojo.Contenido;
import org.satic.persistence.pojo.DAO.GradoDAO;
import org.satic.web.model.FacadeGrado;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author miguel
 */
public class ContenidoRowMapper implements RowMapper<Contenido> {

    @Autowired
    private FacadeGrado gradoDAO;

    @Override
    public Contenido mapRow(ResultSet rs, int i) throws SQLException {
        Contenido c = new Contenido();
        c.setIdContenido(rs.getInt("id_contenido"));
        c.setTipoContenido(rs.getString("tipo_contenido"));
        c.setCategoria(rs.getString("categoria"));
        c.setRuta(rs.getString("ruta"));
        c.setDescripcion(rs.getString("descripcion"));
        c.setTitulo(rs.getString("titulo"));
        return c;
    }

}