package hirondelle.predict.main.preferences;
import static hirondelle.predict.main.preferences.PreferencesAction.CHANGE_PREFERENCES;
import static hirondelle.predict.main.preferences.PreferencesAction.FETCH_PREFERENCES;
import hirondelle.web4j.database.DAOException;
import hirondelle.web4j.database.Db;
import hirondelle.web4j.security.SafeText;
public final class PreferencesDAO {
public Preferences fetch(SafeText aUserId) throws DAOException {
return Db.fetch(Preferences.class, FETCH_PREFERENCES, aUserId);
}
void change(Preferences aPreferences) throws DAOException {
Db.edit(
CHANGE_PREFERENCES,
aPreferences.getScreenName(),
aPreferences.getLoginName()
);
}
}