首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 查询工具(又名ciquta Collection)

查询工具(又名ciquta Collection)

  • 资源大小:27.06 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 工具 查询 又名

资 源 简 介

CiQUTa is a set of utilities to perform queries on Collections and on other data structures using well known Hibernate style idioms as QueryByExample, Criteria and HQL. An example is worth 1000 words Have you ever found a piece of code like that, to extract some useful data from a Collection ? List result = new ArrayList();for(Iterator i = catalog.cars.iterator(); i.hasNext(); ){ Car car = (Car)i.next(); if( car.getModel().equals("518") && car.getMaker().getName().equals("BMW") ){ result.add(car); }} Would you like instead to use that alternative way to obtain the very same result ? List result = CriteriaImpl .forCollection(catalog.cars) .add(Restrictions.eq("model", "518")) .add(Restrictions.eq("maker.name", "BMW")) .list(); If the answer is "yes", give CiQUTa
VIP VIP
0.169131s