Package easyJ.business.facade

Source Code of easyJ.business.facade.UserRightFacade

package easyJ.business.facade;

import java.util.ArrayList;
import easyJ.database.session.Session;
import easyJ.database.session.SessionFactory;
import easyJ.database.dao.command.SelectCommand;
import easyJ.database.dao.DAOFactory;
import easyJ.common.EasyJException;
import easyJ.system.data.UserPropertyRight;

public class UserRightFacade {
    public UserRightFacade() {}

    /**
     * 也就是访问用户对字段权限的表,得到拥有权限的字段
     *
     * @param className
     *                String 要得到属于哪个class的property
     * @param userId
     *                Integer 是哪个用户要访问这个class的数据
     * @return ArrayList 得到此用户拥有权限的属于这个class的所有property
     */
    public static ArrayList getClassProperty(String className, Long userId)
            throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            SelectCommand scmd = DAOFactory
                    .getSelectCommand(UserPropertyRight.class);
            return session.query(scmd);
        } finally {
            if (session != null)
                session.close();
        }
    }

}
TOP

Related Classes of easyJ.business.facade.UserRightFacade

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.