Package easyJ.database.session

Examples of easyJ.database.session.Session.query()


        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(className, condition, orderbyClauses,
                    currentPageNo);
        } finally {
            if (session != null)
                session.close();
        }
View Full Code Here


        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(className, conditions, orderbyClauses);
        } finally {
            if (session != null)
                session.close();
        }
    }
View Full Code Here

        Long problemId = problemvalue.getProblemId();
        Filter filter = DAOFactory.getFilter("problemId", SQLOperator.EQUAL,
                problemId);
        scmd.setFilter(filter);
        Session session = SessionFactory.openSession();
        ArrayList problemvalues = session.query(scmd);
        // 标题
        buffer
                .append("<div class=\"t1\"><div class=\"ico\"><div class=\"icomment\"></div></div>");
        buffer.append("对于问题的价值现有<span style=\"color:#FF0000\">"
                + problemvalues.size() + "</span>个讨论</div>");
View Full Code Here

        scmd = DAOFactory.getSelectCommand(clazz);
        Filter filter2 = DAOFactory.getFilter("creatorId", SQLOperator.EQUAL,
                userId);
        scmd.setFilter(filter2);
        // 查询当前用户是否有或者有过评论
        ArrayList myallevaluation = session.query(scmd);
        session.close();
        // todo:有没有问题应该是针对problem版本的,现在是针problemId,以后需要修改
        if (myallevaluation.size() > 0) {
            if (myevaluation.size() == 0) {
                buffer
View Full Code Here

        Session session = null;
        try {
            session = SessionFactory.openSession();
            SelectCommand scmd = DAOFactory
                    .getSelectCommand(UserPropertyRight.class);
            return session.query(scmd);
        } finally {
            if (session != null)
                session.close();
        }
    }
View Full Code Here

    public void createTree() throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            List valueList = session.query(BeanUtil.getEmptyObject(className));
            if (valueList.size() == 0)
                return;
            createTree(valueList);
        } finally {
            if (session != null)
View Full Code Here

            filter1.addFilter(filter2);
            filter1.addFilter(filter3, LogicOperator.AND);
            filter1.addFilter(filter4, LogicOperator.AND);
            scmd.setFilter(filter1);
            Session session = SessionFactory.openSession();
            messageList = session.query(scmd);
        }
        // 查询系统发送的消息
        else if (choose.equals("2")) {
            message.setMessageReceiver(user.getUserId());
            Long sys = new Long("3");
View Full Code Here

        Filter filter1 = DAOFactory.getFilter("userName", SQLOperator.EQUAL,
                message.getUserName());

        scmd.setFilter(filter1);
        Session session = SessionFactory.openSession();
        ArrayList userId = session.query(scmd);
        if (userId.size() > 0) {
            SysUser sys = (SysUser) userId.get(0);
            message.setMessageReceiver(sys.getUserId());
            SysUserCache syscuercache = (SysUserCache) request.getSession()
                    .getAttribute(Globals.SYS_USER_CACHE);
View Full Code Here

        SelectCommand scmdScenarioVersion = DAOFactory.getSelectCommand(clazz);
        Filter filter = DAOFactory.getFilter("scenarioVersionId",
                SQLOperator.EQUAL, ScenarioVersionId.toString());
        scmdScenarioVersion.setFilter(filter);
        Session session = SessionFactory.openSession();
        ArrayList scenarioVersions = session.query(scmdScenarioVersion);
        if (scenarioVersions.size() == 1) {
            scenarioversion = (ScenarioVersion) scenarioVersions.get(0);
        }
        // 查询上一版本的scenarioversion
        if (oldScenarioVersionId.intValue() > -1) {
View Full Code Here

            SelectCommand scmdOldScenarioVersion = DAOFactory
                    .getSelectCommand(clazz);
            Filter oldfilter = DAOFactory.getFilter("scenarioVersionId",
                    SQLOperator.EQUAL, oldScenarioVersionId.toString());
            scmdOldScenarioVersion.setFilter(oldfilter);
            ArrayList oldscenarioVersions = session
                    .query(scmdOldScenarioVersion);
            if (oldscenarioVersions.size() == 1) {
                oldscenarioversion = (ScenarioVersion) oldscenarioVersions
                        .get(0);
            }
View Full Code Here

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.