日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

atitit.atiOrmStoreService 框架的原理与设计 part1  概述与新特性

發布時間:2025/3/8 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 atitit.atiOrmStoreService 框架的原理与设计 part1  概述与新特性 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

atitit.atiOrmStoreService?框架的原理與設計?part1??概述與新特性

?

?

1.?新特性如下

支持生成sql在無數據庫連接的情況下

?

?

2.?Orm設計

主要的倆個以來service如下

@Inject

Dsl2sqlService?dsl2sqlSvr;

@Inject

DBX?dbSvr;

作者::?綽號:老哇的爪子?(?全名::Attilax?Akbar?Al?Rapanui?阿提拉克斯?阿克巴?阿爾?拉帕努伊?)?漢字名:艾龍,??EMAIL:1466519819@qq.com

轉載請注明來源:?http://www.cnblogs.com/attilax/

?

?

3.?code

?

/atiPlatf_bet/src/com/attilax/store/OrmStoreService.java

?

?

?

package?com.attilax.store;

?

import?java.util.List;

import?java.util.Map;

?

import?com.attilax.db.DBX;

import?com.attilax.io.filex;

import?com.attilax.ioc.IocXq214;

import?com.attilax.json.AtiJson;

import?com.attilax.lang.MapX;

import?com.attilax.orm.AOrm;

import?com.attilax.orm.Aorm4view;

import?com.attilax.orm.View;

import?com.attilax.sql.Dsl2sqlService;

import?com.google.common.collect.Lists;

import?com.google.common.collect.Maps;

import?com.google.inject.Inject;

?

public?class?OrmStoreService?extends?StoreService?{

?

public?static?void?main(String[]?args)?{

System.setProperty("apptype",?"bet");

OrmStoreService?ormSvr?=?IocXq214.getBean(OrmStoreService.class);

Map?m?=?Maps.newLinkedHashMap();

m.put("$table",?"orderView");

m.put("$tabletype",?"view");

m.put("$view_store_path","com/attilax/order");

m.put("$op",?"insert");

m.put("good_id","2005");

m.put("order_id",filex.getUUidName());

List<String>?insertSql?=?ormSvr.insertSql(m);

System.out.println(?AtiJson.toJson(?insertSql));

System.out.println("--f1");

}

?

@Inject

Dsl2sqlService?dsl2sqlSvr;

@Inject

DBX?dbSvr;

?

public?List<String>?insertSql(Map?m)?{

List<String>?li?=?Lists.newArrayList();

if?(m.get("$tabletype")?!=?null?&&?m.get("$tabletype").equals("view"))?{

String[]?tabs?=?new?View(m.get("$table"),?m.get("$view_store_path"))

.getTables();

for?(String?tab?:?tabs)?{

Map?m2?=?MapX.clone(m);

m2.put("$table",?tab);

String?s?=?get_insert_singleTable_sql(m2);

li.add(s);

}

?

return?li;

}

return?li;

}

?

public?void?insert(Map?m)?{

?

List<String>?li?=?insertSql(m);

for?(String?sql?:?li)?{

dbSvr.execSql(sql);

}

?

}

?

public?String?get_insert_singleTable_sql(Map?m)?{

?

String?sql?=?dsl2sqlSvr.dsl2sql(m);

return?sql;

?

}

?

}

?

?

總結

以上是生活随笔為你收集整理的atitit.atiOrmStoreService 框架的原理与设计 part1  概述与新特性的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。