Atitit.列表页and查询条件的最佳实践(1)------设定搜索条件and提交查询and返回json数据
Atitit.列表页and查询条件的最佳实践(1)------设置查询条件and提交查询and返回json数据
3. #----show condition page list 1
5. @filter :: set filter condition use or not use ....or save form .... 2
9. Sigle,range>>>> wehere cause 2
1. 1. 配置条件字段@Conditional 1
2. 2. 配置条件字段显示类型为range----@Conditional(displayType = displayType.rang, rangStart = rang.start, rangEnd = rang.end,op=op.range)
或者dispayType.single..
作者:: 老哇的爪子 Attilax 艾龙, EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
3. #----show condition page list
4. 提交条件查询表单by dwr
//queryBtn_click
Query(1)
function query(isResetPage1)
{
)
resetPageTo1();
var mp=dwr.util.getFormValues("formx");
elmtC.findByPropertyss_page(mp ,function(data){
//alert("保存成功");
bindTableData(data.rows);
});
});
}
5. @filter :: set filter condition use or not use ....or save form ....
6. @converter
7. #----保存每个条件map 4 调试
filex.save_safe( core.toJsonStr(QueryPropertyssMap) , "c:\\json2.txt");
8. #====start
for (Field fld : flds) {
Conditional cdt = fld.getAnnotation(Conditional.class);
if (cdt == null)
continue;
.......
9. Sigle,range>>>> wehere cause
10. Hb pageing
11. Ret page map
Map mp=new HashMap();
mp.put("total" ,SafeVal.val( threadLocal_rowsCount.get(),list_sub.size()));
mp.put("rows",list_sub);
12. #----code
public List findByPropertyss(Map QueryPropertyssMap) {
// log.debug("finding GvMaterial instance with property: " +
// propertyName + ", value: " + value);
core. log("---o720--");
core.logMap(QueryPropertyssMap);
filex.save_safe( core.toJsonStr(QueryPropertyssMap) , "c:\\json2.txt");
String propertyName;
Object value;
Criteria c = getSession().createCriteria(GvMaterial.class);
Field[] flds = GvMaterial.class.getDeclaredFields();
for (Field fld : flds) {
try {
String fldName = fld.getName();
if (fldName.startsWith("playtime")) {
String s = "";
}
if (!includeFldInfoPostMap(QueryPropertyssMap, fldName))
continue;
Conditional cdt = fld.getAnnotation(Conditional.class);
if (cdt == null)
continue;
if (cdt.adptr() != None.class) // cstm mode
//
{
List li = adptrMOde(QueryPropertyssMap, c, fld, fldName,
cdt);
addExpresss(c, li);
} else if (cdt.displayType().equals(displayType.single)) {
// if
// (fld.getType().getName().equals(String.class.getName()))
// {
List<Criterion> exprsLi = getExprs(fldName, cdt.op(),
QueryPropertyssMap);
core.log(String.format("--o7f1: dbg fldinfo: %s---%s ",
fldName, QueryPropertyssMap.get(fldName)));
addExpresss(c, exprsLi);
// Restrictions.like(fldName, "%" + + "%")
} else if (cdt.displayType().equals(displayType.rang)) {
List<Criterion> exprsLi = getExprs(fldName, cdt.op(),
QueryPropertyssMap);
core.log(String.format("--o7f1: dbg fldinfo: %s---%s ",
fldName, QueryPropertyssMap.get(fldName)));
addExpresss(c, exprsLi);
}
//
} catch (Exception e) {
core.log(e);
}
// c.add(Restrictions.eq("aname",name));//eq是等于,gt是大于,lt是小于,or是或
}
c.addOrder(Order.desc("materialId"));
List<GvMaterial> list = c.list();
threadLocal_rowsCount.set(list.size());
Object page = QueryPropertyssMap.get("page_page");
List<GvMaterial> list_sub = PagingUtil.getList(list,
QueryPropertyssMap.get("pagesize"), page);
return list_sub;
}
13. 參考
atitit.提升开发效率---MDA 软件开发方式的革命(5)----列表查询建模 - attilax的专栏 - 博客频道 - CSDN.NET.htm
版权声明:本文博主原创文章,博客,未经同意不得转载。
Atitit.列表页and查询条件的最佳实践(1)------设定搜索条件and提交查询and返回json数据的更多相关文章
- Atitit.列表页面and条件查询的实现最佳实践(1)------设置查询条件and提交查询and返回json数据
Atitit.列表页面and条件查询的实现最佳实践(1)------设置查询条件and提交查询and返回json数据 1. 1. 配置条件字段@Conditional 1 1 2. 2. 配置条件字段 ...
- Atitit..文件上传组件选型and最佳实践总结(3)----断点续传控件的实现
Atitit..文件上传组件选型and最佳实践总结(3)----断点续传控件的实现 1. 实现思路:::元插件,元设置... 1 2. 实现流程downzip,unzip,exec 1 3. Zip ...
- Atitit..文件上传组件选型and最佳实践总结(2)----断点续传
Atitit..文件上传组件选型and最佳实践总结(2)----断点续传 1. 断点续传的原理 1 2. 如何判断一个插件/控件是否支持断点续传?? 1 3. 常用的组件选型结果::马 1 4. 自定 ...
- atitit.hbnt orm db 新新增更新最佳实践o99
atitit.hbnt orm db 新新增更新最佳实践o99 1. merge跟个save了. 1 2. POJO对象处于游离态.持久态.托管态.使用merge()的情况. 1 3. @Dynami ...
- atitit.hbnt orm db 新新增更新最佳实践o7
atitit.hbnt orm db 新新增更新最佳实践o7 1. merge跟个save了. 1 2. POJO对象处于游离态.持久态.托管态.使用merge()的情况. 1 3. @Dynamic ...
- atitit.标准时间格式 互相转换 秒数 最佳实践
atitit.标准时间格式 互相转换 秒数 最佳实践 例如00:01:19 转换为秒数 79,,and互相转换 一个思路是使用div 60 mod...不过麻烦的... 更好的方法是使用stamp ...
- Atitit. 软件设计 模式 变量 方法 命名最佳实践 vp820 attilax总结命名表大全
Atitit. 软件设计 模式 变量 方法 命名最佳实践 vp820 attilax总结命名表大全 1. #====提升抽象层次1 2. #----使用通用单词1 3. #===使用术语..1 4. ...
- Atitit..文件上传组件选择and最佳实践的总结(2)----HTTP
Atitit..文件上传组件选型and最佳实践总结(2)----断点续传 1. 断点续传的原理 1 2. 怎样推断一个插件/控件是否支持断点续传?? 1 3. 经常使用的组件选型结果::马 1 4. ...
- 查询返回JSON数据结果集
查询返回JSON数据结果集 设计目标: 1)一次性可以返回N个数据表的JSON数据 2)跨数据库引擎 { "tables": [ { "cols": [ { & ...
随机推荐
- 计算机视觉与模式识别代码合集第二版three
计算机视觉与模式识别代码合集第二版three Topic Name Reference code Optical Flow Horn and Schunck's Optical Flow ...
- Java IO学习笔记:概念与原理
Java IO学习笔记:概念与原理 一.概念 Java中对文件的操作是以流的方式进行的.流是Java内存中的一组有序数据序列.Java将数据从源(文件.内存.键盘.网络)读入到内存 中,形成了 ...
- leetcode day6 -- String to Integer (atoi) && Best Time to Buy and Sell Stock I II III
1. String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully con ...
- android用于打开各种文件的intent
import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.n ...
- Linux Shell脚本入门--grep命令详解
grep简介<摘自鸟哥,并加以整理.> grep (global search regular expression(RE) and print out the line,全面搜索正则表达 ...
- curl的封装
首先要搭建一个httpserver,这里採用tomcat6为例: 过程:新建一个Servlet,并使用tomcat的默认port号8080监听,最后写一个jsp来測试能否够訪问该server 1)新建 ...
- 低版本的 opencv库的 vs2010 打开 高版本opencv
打开track.vcxproj文件, 注释掉跟版本有关的行就可. 本例子中,当用双击.sln用vs2010打开高版本的opencv项目时,会出现错误, 并且会有错误信息提示,双击该错误信息,就会打开该 ...
- Eclipse插件基础篇一
名词翻译 有一些名词在翻译的过程中可能会出现歧义,在这里统一一下. アーキテクチャ=architecture=架构 プラットフォーム=platform=平台 コンポーネント=component=组件 ...
- 关于多线程的一个例子(UI实时显示)
在开发Window应用程序的时候,经常需要在界面上显示出已经执行到什么步骤了,拿一个简单例子来说,创建一个Winform程序,在窗体上访一个Button和一个Label,点击Button时做100次循 ...
- zoj 3822 Domination (可能性DP)
Domination Time Limit: 8 Seconds Memory Limit: 131072 KB Special Judge Edward is the headm ...