首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

在hibernate中怎么按顺序排序呢

2012-10-28 
在hibernate中如何按顺序排序呢?在hibernate中如何按顺序排序呢?以前用sql语言就是select*fromtextorderby

在hibernate中如何按顺序排序呢?
在hibernate中如何按顺序排序呢? 
以前用sql语言就是select  *  from  text  order  by  id  desc  来按顺序排序,现在在hibernate中,我的代码是这样子的. 
public  Text  getText(long  id)  { 
                        
                       s  =  SessionFactory.currentSession(); 
                       Transaction  tx  =  s.beginTransaction(); 
                       Long  theId  =  new  Long(id); 
                       Text  text  =  (Text)  s.load(Text.class,  theId); 
                       tx.commit(); 
                       return  text; 
           } 
返回了text后,但在jsp网页中只是从最后的数据显示到最新的数据,不是最新的放在前面,应该如何调试.请指点. 1 楼 hexiaodong 2006-10-17   你返回一个对象,怎么排序?!

热点排行