天天看點

flex 背景使用spring hibernate 分頁

<a href="http://www.iteye.com/topic/87035">http://www.iteye.com/topic/87035</a>

flex 背景使用spring hibernate 分頁

@override  

    public list&lt;employee&gt; listall(int start, int step) {  

//      session s =  this.gethibernatetemplate().getsessionfactory().getcurrentsession();  

        session s =  this.gethibernatetemplate().getsessionfactory().opensession ();  

//      system.out.println(s);  

        query q =s.createquery("from employee");   

        q.setfirstresult(start);   

        q.setmaxresults(step);   

        list l = q.list();   

        if(l != null)  

            return l;  

        else  

            return null;  

    }