statement = con.prepareStatement("REPLACE residence_functions SET id=?, type=?, lvl=?, endTime=?");
statement.setInt(1, getId());
statement.setInt(2, type);
statement.setInt(3, level);
statement.setInt(4, (int) (time / 1000));
statement.execute();
function.setLvl(level);
function.setEndTimeInMillis(time);
function.setActive(true);
StartAutoTaskForFunction(function);
}