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

比springside PropertyFilter加强灵活的FieldFilter

2012-09-09 
比springside PropertyFilter增强灵活的FieldFilter,?完整代码附件内??SpringSide PropertyFilter 的缺点:

比springside PropertyFilter增强灵活的FieldFilter,

?完整代码附件内

?

?SpringSide PropertyFilter 的缺点:

?

1,不能A or B or C

?

2, 不能( A or B) and c

?

3, 不能包含between

?

4,不能属性间比较 field2 >field2

?

5,很难看的下划线 EQS_compId EQS_userName GES_recTime

?

6,即使已经知道具体类型,但也要转换成字符串

?

?

?

?事例:

?

public Setting getSetting(String key) {List<FieldFilter> filters = new ArrayList<FieldFilter>();FieldFilter ff1 = new FieldFilter("keyField", "data", MatchType.EQF);FieldFilter ff2 = new FieldFilter("data", MatchType.BETWEEN, "3", "6");FieldFilter ff3 = new FieldFilter("data", MatchType.BETWEEN, "4", "8");ff1.addRoundAndFilter(ff2);ff2.addOrFilter(ff3);filters.add(ff1);settingDao.find(filters);return null;}

?

?

?

?

?生成sql

?

?? select
??????? this_.keyField as keyField0_0_,
??????? this_.version as version0_0_,
??????? this_.data as data0_0_,
??????? this_.description as descript4_0_0_,
??????? this_.orderby as orderby0_0_
??? from
??????? setting this_
??? where
??????? (
??????????? this_.keyField=this_.data
??????????? and this_.data between ? and ?
??????? )
??????? or this_.data between ? and ?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

1 楼 wzjsyj 2011-09-21   你好,能不能给个完整的例子,非常感谢,253436278@qq.com 2 楼 hljxpf 2012-03-10   源码引用的包,给得不全啊

热点排行