Bee v1.6.0 发布,增加面向对象方式复杂查询支持

栏目: 软件资讯 · 发布时间: 6年前

内容简介:Bee 是一个简单,高效,开发速度快的 JAVA ORM 框架。 具有人工智能(AI)、省时/优雅、简单易用、自动( Tea: Timesaving/Tasteful, Easy, Automatic) 风格的软件(AITeaSoft)。 V1.6 1.Suid增加面向对象方式复杂查询...

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]
 

更多相关信息,请关注微信公众号:软件设计活跃区


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Blog Design Solutions

Blog Design Solutions

Richard Rutter、Andy Budd、Simon Collison、Chris J Davis、Michael Heilemann、Phil Sherry、David Powers、John Oxton / friendsofED / 2006-2-16 / USD 39.99

Blogging has moved rapidly from being a craze to become a core feature of the Internetfrom individuals sharing their thoughts with the world via online diaries, through fans talking about their favori......一起来看看 《Blog Design Solutions》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具