- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: http://git.oschina.net/h5lib/jsql
- 软件文档: http://git.oschina.net/h5lib/jsql/blob/master/README.md
软件介绍
Jsql 是 Jfinal 的 SQL 插件
主要特点:
SQL与JAVA代码分离
XML配置
JS语法的SQL模板引擎,简单易学
模板标签:
<%=%> ,例如:name = <%=name%>,将转换成 name = ? ,并将参数变量添加到Args中
<%-%> ,例如:name = <%-name%>,将转换成 name = ? ,并将参数变量转义后添加到Args中
<%+%> ,例如:name = <%+name%>,将转换成 name = 'jfinal'
用法:
主配置文件JSql-Config.xml
<?xml version="1.0" encoding="UTF-8"?> <jsqlconfig> <jsqlpath path="/JSql-User.xml" /> </jsqlconfig>
SQL配置文件JSql-User.xml
<?xml version="1.0" encoding="UTF-8"?> <jsql namespace="user"> <sql id="getusers"> <![CDATA[ select * from user t where 1 =1 and <%if(typeof(state) != 'undefined'){%> t.state = <%=state%> <%}%> <%if(typeof(ids) != 'undefined'){%> and t.id in (<%for(var i=0;i<ids.length;i++){%> <%=ids[i]%> <%if(i < ids.length-1){%> , <%}%> <%}%>) <%}%> order by name desc ]]> </sql> </jsql>JAVA初始化
new JSqlPlugin("/JSql-Config.xml").start();调用SQL
Map<String, Object> m = new HashMap<String, Object>(); SqlArgs sqlArgs = JSqlKit.getSqlArgs("user.getusers",m);执行SQL语句
Db.find(sqlArgs.getSql(), sqlArgs.getArgs().toArray());
High Performance Python
Micha Gorelick、Ian Ozsvald / O'Reilly Media / 2014-9-10 / USD 39.99
If you're an experienced Python programmer, High Performance Python will guide you through the various routes of code optimization. You'll learn how to use smarter algorithms and leverage peripheral t......一起来看看 《High Performance Python》 这本书的介绍吧!
