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 概述与新特性的更多相关文章
- atitit. web组件化原理与设计
atitit. web组件化原理与设计 1. Web Components提供了一种组件化的推荐方式,具体来说,就是:1 2. 组件化的本质目的并不一定是要为了可复用,而是提升可维护性. 不具有复用 ...
- Atitit.ati dwr的原理and设计 attilax 总结 java php 版本
Atitit.ati dwr的原理and设计 attilax 总结 java php 版本 1. dwr的优点相对于ajax来说..1 2. DWR工作原理1 3. Dwr的架构2 4. 自定义dwr ...
- Atitit 发帖机系列(8) 词法分析器v5 版本新特性说明)
Atitit 发帖机系列(8) 词法分析器v5 版本新特性说明) v5 增加对sql单引号的内部支持.可以作为string 结构调整,使用递归法重构循环发..放弃循环发. V4 java dsl词 ...
- Atitit.mysql 5.0 5.5 5.6 5.7 新特性 新功能
Atitit.mysql 5.0 5.5 5.6 5.7 新特性 新功能 1. MySQL 5.6 5 大新特性1 1.1. 优化器的改进1 1.2. InnoDB 改进1 1.3. 使用 ...
- Atitit.mysql 5.0 5.5 5.6 5.7 新特性 新功能
Atitit.mysql 5.0 5.5 5.6 5.7 新特性 新功能 1. MySQL 5.6 5 大新特性1 1.1. 优化器的改进1 1.2. InnoDB 改进1 1.3. 使用 ...
- JVM的运行原理以及JDK 7增加的新特性(二)
JVM结构 Java编写的代码会按照下图的流程来执行 类装载器装载负责装载编译后的字节码,并加载到运行时数据区(Runtime Data Area),然后执行引擎执行会执行这些字节码. 类加载器(Cl ...
- Atitit.eclipse 4.3 4.4 4.5 4.6新特性
Atitit intellij idea的使用总结attilax 1. ideaIC-2016.2.4.exe1 1.1. Ij vs eclipse市场份额1 1.2. Ij的优点(方便的支持gro ...
- JVM的运行原理以及JDK 7增加的新特性(一)
虚拟机(Virtual Machine) JRE是由Java API和JVM组成的.JVM的主要作用是通过Class Loader来加载Java程序,并且按照Java API来执行加载的程序. 虚拟机 ...
- 类的加载、时机、反射、模板设计、jdk7/jdk8新特性(二十六)
1.类的加载概述和加载时机 * A:类的加载概述 * 当程序要使用某个类时,如果该类还未被加载到内存中,则系统会通过加载,连接,初始化三步来实现对这个类进行初始化. * 加载 * 就是指将class文 ...
随机推荐
- 8、Flask实战第8天:add_url_rule和app.route原理
之前我们使用@app.route这个装饰器来把视图函数和url绑定 @app.route('/') def hell_world(): return 'hello world' 而且我们可以通过url ...
- Express下使用formidable实现POST表单上传文件并保存
Express下使用formidable实现POST表单上传文件并保存 在上一篇文章中使用formidable实现了上传文件,但没将它保存下来. 一开始,我也以为是只得到了文件的相关信息,需要用fs. ...
- POJ 2932 Coneology(扫描线)
[题目链接] http://poj.org/problem?id=2932 [题目大意] 给出N个两两没有公共点的圆,求所有不包含于其它圆内部的圆 [题解] 我们计算出所有点在圆心所有y位置的x值, ...
- Problem Q: 零起点学算法12——求2个日期之间的天数
#include<stdio.h> int main() { int a1,b1,c1,a2,b2,c2,s; scanf("%d-%d-%d",&a1,&am ...
- Windows python 3 安装OpenCV
本文适用于想在window下使用python 3 的童鞋,安装openCV 有问题的参考 一.你要确定自己的python版本是3.x,在命令行窗口输入python 本人使用的是python 3.6 二 ...
- hdu 1054 Strategic Game(tree dp)
Strategic Game Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- 如何查看oracle的sid
1.怎样查看Oracle的数据库名称sid 用sysdba身份登录 比如 conn sys/密码 as sysdba 匿名管理员登陆 执行 select name form V$database; ...
- AtomicInteger类的简单应用
AtomicInteger,一个提供原子操作的Integer的类.在Java语言中,++i和i++操作并不是线程安全的,在使用的时候,不可避免的会用到synchronized关键字.而AtomicIn ...
- 网络流量工具iftop,ifstat
此文非原创,转自 http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858923.html 介绍 ifstat工具是个网络接口监测工具,比较简单 ...
- 不区分大小写的Flask-SQLAlchemy查询
全部转换为小写字符再进行比较 from sqlalchemy import func user = models.User.query.filter(func.lower(User.username) ...