Code example for BeanPropertyRowMapper

0
        setDataSource(dataSource); 
    } 
     
    @Override 
    public List<User> listarTodos() { 
        return getJdbcTemplate().query( 
                "select * from sunat_user", 
                new BeanPropertyRowMapper<User>(User.class)); 
    } 
 
    @Override 
    public Integer insertar(User object) { 
        getJdbcTemplate().update( 
                "insert into sunat_user(full_name, username, salt, password," 
                + "email, is_active) values(?, ?, ?, ?, ?, ?)", 
                object.getFullname(), object.getUsername(), object.getSalt(), 
                object.getPassword(), object.getEmail(), object.getActive()); 
        return getJdbcTemplate().queryForInt("select last_insert_id()"); 
    }