Package easyJ.database.session

Examples of easyJ.database.session.Session


                session.close();
        }
    }

    public ArrayList query(Object lower, Object upper) throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(lower, upper);
        } finally {
            if (session != null)
                session.close();
        }

    }
View Full Code Here


    }

    public ArrayList query(Object lower, Object upper, OrderRule[] orderRules)
            throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(lower, upper, orderRules);
        } finally {
            if (session != null)
                session.close();
        }

    }
View Full Code Here

        }

    }

    public Page query(Object o, int currentPageNo) throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(o, currentPageNo);
        } finally {
            if (session != null)
                session.close();
        }

    }
View Full Code Here

    }

    public Page query(Object o, int currentPageNo, OrderRule[] orderRules)
            throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(o, currentPageNo, orderRules);
        } finally {
            if (session != null)
                session.close();
        }

    }
View Full Code Here

    }

    public Page query(Object lower, Object upper, int currentPageNo)
            throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(lower, upper, currentPageNo);
        } finally {
            if (session != null)
                session.close();
        }

    }
View Full Code Here

    }

    public Page query(Object lower, Object upper, int currentPageNo,
            OrderRule[] orderRules) throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.query(lower, upper, currentPageNo, orderRules);
        } finally {
            if (session != null)
                session.close();
        }
    }
View Full Code Here

                session.close();
        }
    }

    public Object get(Object o) throws EasyJException {
        Session session = null;
        try {
            session = SessionFactory.openSession();
            session.setAccurateProperties(accurateProperties);
            // change the o's use_state
            return session.get(o);
        } finally {
            if (session != null)
                session.close();
        }

    }
View Full Code Here

    }

    /* 此方法可以支持用户自定义的条件和排序字段 */
    public Page query(String className, String condition,
            String orderbyClauses, int currentPageNo) throws EasyJException {
        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

    }

    public ArrayList query(String className, String conditions,
            String orderbyClauses) throws EasyJException {
        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

        SelectCommand scmd = DAOFactory.getSelectCommand(clazz);
        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>");
        // 投票面板,先从缓存中得到目前用户的信息,然后查看ProblemvalueTypeValue表,是否已经投过票了,这里更高的效率应该是用主子表查询
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        pvtv.setProblemId(problemvalue.getProblemId());
        // evaluation所有人的关于这个问题可理解行的没有过期的投票结果。
        ArrayList evaluation_num = cdp.query(pvtv);
        pvtv.setCreatorId(userId);
        // 当前登陆者关于这个问题可理解行的没有过期的投票结果。
        ArrayList myevaluation = cdp.query(pvtv);
        o = BeanUtil
                .getEmptyObject("cn.edu.pku.dr.requirement.elicitation.data.ProblemvalueTypeValue");
        clazz = o.getClass();
        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
                        .append("<div class=\"bc0\" style=\"padding:0px 0pt;\" id=\"notyetvoting\"><div class=\"t2\">问题已修改,请重新投票&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"f12 gray\" style=\"font-weight:normal\">目前有 "
View Full Code Here

TOP

Related Classes of easyJ.database.session.Session

Copyright © 2018 www.massapicom. 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.