不知道我乱七八糟想的这些可不可行,也不知道实际应用中,人家都是怎么用的,反正我今天折腾了一种方法,分享一下.
首先的数据呢,很多,所以要考虑分页.
然后是用的hibernate的分页技术,既然用了就用了,谁怕谁,真是的.
主要个流程是这样的:
首先管理员登陆系统后,应该是上面有查询的选择,下面首先应该显示出来所有的记录,当然要用分页.像是这样:
然后呢,提交查询条件后,下面显示对应的查询结果.
我后来就想一想呀,应该要把全部查询和条件查询分开的,主要是为了在分页的时候点击上一页下一页的时候可以不混起来.
怎么实现的呢
这样:条件查询的情况,我会传一个cmd=inquiry过去,判断有这个值的话,说明是条件查询显示,如果是第一次查,也就是说点击查询按钮的时候,我先转到一个action里面,将查询的条件记录下来,我的方法是放到session里面,放到session里面的主要目的是为了后面点击下一页或者是上一页的时候去获取当时的查询条件.如果不是第一次条件查询,那么说明session里面已经存了查询条件的内容,这个时候直接在session里面取出来进行分页查询就可以了.
如果cmd是空,就是全部查询,如果不是空,就是条件查询的,嘻嘻.
记录一下主要代码:
省了get/set方法哈.
最后记录一下hibernate查询的方法:
我就是用拼音,真是的,嘻嘻嘻嘻~
分享到:
相关推荐
该模型由乐高团队(SIT NUM)在2010年秋季开发。团队成员:Davaadorj,Munkhdul,Khuyagbaatar
校友骨干客户校友骨干应用程序原型。
校友API 这是校友的原型api,用node编写。
校友校友 Django 项目
go_alumnus
校友录管理系统(ARMS:Alumnus Record Management System)用于个人用户进行校友信息的管理,要求完成的主要的功能有录入、修改、删除、查询、排序校友信息。可以完成密码登录系统、按不同名录查找信息、按姓名或届...
An alumnus of the University of North Carolina and New York University, he lives in Brooklyn with his wife and cat. Table of Contents The Fundamentals of Machine Learning Simple linear regression ...
An alumnus of the University of North Carolina and New York University, he lives in Brooklyn with his wife and cat. Contents Chapter 1. The Fundamentals of Machine Learning Chapter 2. Simple linear ...
Ashish Kumar is an IIM alumnus and an engineer at heart. He has extensive experience in data science, machine learning, and natural language processing having worked at organizations, such as McAfee-...
Ashish Kumar is an IIM alumnus and an engineer at heart. He has extensive experience in data science, machine learning, and natural language processing having worked at organizations, such as McAfee-...
Caltech PS sample更多模板:http://alumnus.caltech.edu/~natalia/studyinus/guide/statem
Clark Lay, are all distinguished mathematicians, and in 1989 they jointly received the Outstanding Alumnus award from their alma mater, Aurora University. In 2006, Steven was honored to receive the ...
Some teachers are not allowed to put their PPTs on the Internet, so please don't spread them everywhere.The only reason for this Repository's existence is helping alumnus to make preview and review ...