首页 | 本学科首页   官方微博 | 高级检索  
     

基于JSON格式的自定义组合条件查询设计与实现
引用本文:封侣. 基于JSON格式的自定义组合条件查询设计与实现[J]. 电子世界, 2014, 0(12): 79-80
作者姓名:封侣
作者单位:中海油田服务股份有限公司
摘    要:查询模块在软件系统的开发中属于基本的必需模块,条件与对象属性相对应,而对象属性与表字段相对应,前台条件以And或者Or组装成JSON格式的数据,后台接受来自于前台的JSON数据进行一系列处理最终拼接为Hql字符串进而查询出满足条件的数据返回给前台展示。前台的查询条件组装成JSON格式数据借助于ligerui的ligerFilter插件,后台借助java代码对JSON格式数据进行处理。由于对象属性字段与数据表字段的对应采用了Hibernate映射框架,故在程序中对实体对象的操作相当于对数据库表的操作,这样简化了后台查询代码的编写工作,并且使得查询代码易于维护。

关 键 词:组合  条件  查询  JSON  ligerui  ligerFilter  Hibernate

THE DESIGN AND IMPLEMENTATION BASED ON CUSTOM QUERY COMBINATION OF CONDITIONS
Feng Lv. THE DESIGN AND IMPLEMENTATION BASED ON CUSTOM QUERY COMBINATION OF CONDITIONS[J]. Electronics World, 2014, 0(12): 79-80
Authors:Feng Lv
Affiliation:Feng Lv;China Oilfield Services Limited;
Abstract:Query module is a basic required module in the development of software systems.Conditions relate to object properties which are corresponded with the table ifelds.Reception conditions which are connected with And or Or assemble into data in JSON Format.Background accepts the JSON data from the reception and processes it by a series processes,at last splices into Hql String to query the data to meet conditions and displays it in the front.The front query combination of conditions assembles into data in JSON format by the ligerFilter plug of ligerui,and the background processes the JSON data by java.Because object attribute ifelds are corresponded with the data table ifelds in a Hibernate mapping framework,the operation on the entity object is equivalent to the database table in the program to simplify the coding work of background query code and to make it easier to maintain.
Keywords:Combination  Conditions  Query  JSON  ligerui  ligeruiFilter  Hibernate
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号