Bee v1.6.0 发布,增加面向对象方式复杂查询支持
时间:2019-11-28 16:31 来源:linux.it.net.cn 作者:IT
Bee 是一个简单,高效,开发速度快的 JAVA ORM 框架。
具有人工智能(AI)、省时/优雅、简单易用、自动( Tea: Timesaving/Tasteful, Easy, Automatic) 风格的软件(AITeaSoft)。
V1.6
1.Suid增加面向对象方式复杂查询支持.
Suid接口增加方法:public List select(T entity,Condition condition);
支持范围查询;支持同时使用范围查询、模糊查询、in、>、>=、<、<=、分组、having过滤、排序、分页等复杂查询。
2.SuidRich增加面向对象方式复杂查询支持.
SuidRich接口增加方法:
select(T entity, IncludeType includeType, Condition condition)
selectJson(T entity, IncludeType includeType, Condition condition)
3.SuidRich增加更新方法:
updateBy(T entity,String whereFieldList)
updateBy(T entity,String whereFieldList,IncludeType includeType)
4.add SqlNullException in PreparedSqlLib.
例子(DB用MySQL):
public class ConditionExam1 {
public static void main(String[] args) {
Suid suid = BeeFactory.getHoneyFactory().getSuid();
Orders orders = new Orders();
orders.setName("KS"); //等于的条件,会默认转换
Condition condition=new ConditionImpl();
condition
.op("userid", Op.like, "Bee%") //模糊查询
.between("total", 90, 100) //范围查询
.between("createtime","2019-10-01","2019-11-12")
.orderBy("userid",OrderType.ASC) //排序
.start(0).size(10) //分页
;
List<Orders> list2 = suid.select(orders, condition);
for (int i = 0; i < list2.size(); i++) {
System.out.println(list2.get(i).toString());
}
}
}
运行结果:
2019-11-27 20:40:29 [INFO] select SQL:
select id,userid,name,total,createtime,remark,sequence from orders where name=? and userid like ? and total between ? and ? and createtime between ? and ? order by userid asc limit 0,10 [values]: KS,Bee%,90,100,2019-10-01,2019-11-12
Orders[id=100040,userid=Bee,name=KS,total=95.90,createtime=2019-11-11 21:30:38.0,remark=双11购物,sequence=123456789]
(责任编辑:IT)
Bee 是一个简单,高效,开发速度快的 JAVA ORM 框架。 具有人工智能(AI)、省时/优雅、简单易用、自动( Tea: Timesaving/Tasteful, Easy, Automatic) 风格的软件(AITeaSoft)。 V1.6 1.Suid增加面向对象方式复杂查询支持. Suid接口增加方法:public List select(T entity,Condition condition); 支持范围查询;支持同时使用范围查询、模糊查询、in、>、>=、<、<=、分组、having过滤、排序、分页等复杂查询。 2.SuidRich增加面向对象方式复杂查询支持. SuidRich接口增加方法: select(T entity, IncludeType includeType, Condition condition) selectJson(T entity, IncludeType includeType, Condition condition) 3.SuidRich增加更新方法: updateBy(T entity,String whereFieldList) updateBy(T entity,String whereFieldList,IncludeType includeType) 4.add SqlNullException in PreparedSqlLib. 例子(DB用MySQL): public class ConditionExam1 { public static void main(String[] args) { Suid suid = BeeFactory.getHoneyFactory().getSuid(); Orders orders = new Orders(); orders.setName("KS"); //等于的条件,会默认转换 Condition condition=new ConditionImpl(); condition .op("userid", Op.like, "Bee%") //模糊查询 .between("total", 90, 100) //范围查询 .between("createtime","2019-10-01","2019-11-12") .orderBy("userid",OrderType.ASC) //排序 .start(0).size(10) //分页 ; List<Orders> list2 = suid.select(orders, condition); for (int i = 0; i < list2.size(); i++) { System.out.println(list2.get(i).toString()); } } } 运行结果: 2019-11-27 20:40:29 [INFO] select SQL: select id,userid,name,total,createtime,remark,sequence from orders where name=? and userid like ? and total between ? and ? and createtime between ? and ? order by userid asc limit 0,10 [values]: KS,Bee%,90,100,2019-10-01,2019-11-12 Orders[id=100040,userid=Bee,name=KS,total=95.90,createtime=2019-11-11 21:30:38.0,remark=双11购物,sequence=123456789] (责任编辑:IT) |