Bee v1.6.0 發布,增加面向對象方式複雜查詢支持

←手機掃碼閱讀     admin @ 2019-11-28 , reply:0

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]
 

更多相關信息,請關注微信公眾號:軟體設計活躍區





[admin ]

來源:OsChina
連結:https://www.oschina.net/news/111659/bee-1-6-0-released
Bee v1.6.0 發布,增加面向對象方式複雜查詢支持已經有22次圍觀

http://coctec.com/news/all/show-post-220585.html