Package com.javaeye.jert.service.impl

Source Code of com.javaeye.jert.service.impl.UserPrefsServiceDefaultImpl

package com.javaeye.jert.service.impl;

import java.util.List;
import java.util.Locale;

import com.javaeye.core.service.AbstractService;
import com.javaeye.jert.domain.ReportInstance;
import com.javaeye.jert.domain.user.UserPrefs;
import com.javaeye.jert.service.UserPrefsService;

/**
* @author Quake Wang
* @since 2005-1-23
* @version $Revision: 1.2 $
*/
public class UserPrefsServiceDefaultImpl extends AbstractService implements UserPrefsService {

    public UserPrefs loadUserPrefs(String userName) {
        List result = findByNamedQuery("findUserPrefsByUserName", userName);
        if (result != null && result.size() > 0) { return (UserPrefs) result.get(0); }
        return new UserPrefs(Locale.getDefault(), new Integer(ReportInstance.DEFAULT_COUNT_ON_EACH_PAGE));
    }

    public void createUserPrefs(UserPrefs userPrefs) {
        create(userPrefs);
    }

    public void updateUserPrefs(UserPrefs userPrefs) {
        update(userPrefs);
    }

}
TOP

Related Classes of com.javaeye.jert.service.impl.UserPrefsServiceDefaultImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.