浏览 4301 次
锁定老帖子 主题:在hibernate中如何按顺序排序呢?
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2006-10-16
以前用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网页中只是从最后的数据显示到最新的数据,不是最新的放在前面,应该如何调试.请指点. 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2006-10-17
你返回一个对象,怎么排序?!
|
|
返回顶楼 | |