https://github.com/Dreampie/jfinal-sqlinxml jfinal-sqlinxml是一款java下的sql存储到xml文件的插件
<dependency> <groupId>cn.dreampie</groupId> <artifactId>jfinal-sqlinxml</artifactId> <version>${jfinal-sqlinxml.version}</version> </dependency>
目前刚刚发布第一个版本0.1:
<jfinal-sqlinxml.version>0.1</jfinal-sqlinxml.version>
使用方法:
在jfinal config里configPlugin方法加入
//sql语句plugin plugins.add(new SqlInXmlPlugin("/sql"));//可以添加多个路径
文件名以XX_sql.xml格式(_sql.xml为后缀)
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <sqlRoot> <sqlGroup name="blog"> <sql id="findInfoBySelect"> SELECT `blog`.*,`user`.id user_id,`user`.full_name full_name,`department`.id department_id,`department`.name department_name </sql> <sql id="findInfoByExceptSelect"> FROM blog `blog` LEFT JOIN sec_user `user` ON(`blog`.user_id=`user`.id) LEFT JOIN department `department` ON(`user`.department_id=`department`.id) </sql> </sqlGroup> <sqlGroup name="permission"> <sql id="findRoleByExceptSelect">FROM sec_permission `permission` WHERE `permission`.id IN (SELECT `role_permission`.permission_id FROM sec_role_permission `role_permission` WHERE `role_permission`.role_id=?) </sql> </sqlGroup> </sqlRoot>
在model里的使用
public List<Permission> findByRole(String where, Object... paras) { List<Permission> result = find(getSelectSql() + SqlKit.sql("permission.findRoleByExceptSelect") + blank + getWhere(where), paras); return result; }
https://github.com/Dreampie?tab=repositories 目录下有多款插件:
cn.dreampie.jfinal-shiro https://github.com/Dreampie/jfinal-shiro shiro插件
cn.dreampie.jfinal-shiro-freemarker https://github.com/Dreampie/jfinal-shiro-freemarker shiro插件实现的freemarker标签库
cn.dreampie.jfinal-web https://github.com/Dreampie/jfinal-web 相关web插件,简洁model实现
cn.dreampie.jfinal-utils https://github.com/Dreampie/jfinal-utils 部分jfinal工具
cn.dreampie.jfinal-tablebind https://github.com/Dreampie/jfinal-tablebind jfinal的table自动绑定插件,支持多数据源
cn.dreampie.jfinal-flyway https://github.com/Dreampie/jfinal-flyway 数据库脚本升级插件,开发中升级应用时,使用脚本同步升级数据库或者回滚
cn.dreampie.jfinal-captcha https://github.com/Dreampie/jfinal-captcha 基于jfinal render的超简单验证吗插件
cn.dreampie.jfinal-quartz https://github.com/Dreampie/jfinal-quartz 基于jfinal 的quartz管理器
cn.dreampie.jfinal-sqlinxml https://github.com/Dreampie/jfinal-sqlinxml 基于jfinal 的类似ibatis的sql语句管理方案
cn.dreampie.jfinal-lesscss https://github.com/Dreampie/jfinal-lesscss java实现的lesscsss实时编译插件,可以由于jfinal
cn.dreampie.jfinal-coffeescript https://github.com/Dreampie/jfinal-coffeescript java实现的coffeescript实时编译插件,可以由于jfinal
cn.dreampie.jfinal-akka https://github.com/Dreampie/jfinal-akka java使用akka执行异步任务
cn.dreampie.jfinal-mailer https://github.com/Dreampie/jfinal-mailer 使用akka发布邮件的jfinal插件
cn.dreampie.jfinal-slf4j https://github.com/Dreampie/jfinal-slf4j 让jfinal使用slf4j的日志api
部分内容借鉴了网络资料