class UserStore {

    public boolean update(int id, User user) {
        boolean done = false;
        if (ADDRESS_STORE.update(id, user.getAddress())) {
            try (Connection con = CON.getConnect();
            PreparedStatement upUsr = con.prepareStatement(QUERIES.getProperty("updateUser"))) {
                upUsr.setInt(1, ROLE_STORE.findRoleId(user.getRole()));
                upUsr.setString(2, user.getPassword());
                upUsr.setString(3, user.getLogin());
                upUsr.setString(4, user.getName());
                upUsr.setInt(5, id);
                upUsr.execute();
                this.deleteUserType(con, id);
                this.insertUserType(id, user);
                done = true;
            } catch (SQLException e) {
                LOG.error(e.getMessage(), e);
            }
        }
        return done;
    }

}