package com.utopiaindustries.dao.ctp;

import com.utopiaindustries.model.ctp.User;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class UserRowMapper implements RowMapper<User> {

    @Override
    public User mapRow(ResultSet rs, int i ) throws SQLException {
        User user = new User();
        user.setUsername( rs.getString( "username" ) );
        user.setPassword( rs.getString( "password" ) );
        user.setEnabled( rs.getBoolean( "enabled" ) );
        return user;
    }
}
