{"id":13471374,"url":"https://github.com/jeecgboot/MiniDao","last_synced_at":"2025-03-26T13:31:00.989Z","repository":{"id":37283507,"uuid":"12192730","full_name":"jeecgboot/MiniDao","owner":"jeecgboot","description":"一款极其轻量的JAVA持久层框架，基于 SpringJdbc + freemarker 实现，具备Mybatis一样的SQL分离和逻辑标签能力，可无缝集成springboot项目。","archived":false,"fork":false,"pushed_at":"2024-12-02T21:41:53.000Z","size":23087,"stargazers_count":213,"open_issues_count":13,"forks_count":169,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-01-11T12:03:02.823Z","etag":null,"topics":["hibernate","jdbc","jpa","mybatis","mybatis-plus","spring-boot","spring-jdbc","springboot","springjdbc","sql"],"latest_commit_sha":null,"homepage":"http://www.jeecg.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeecgboot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-18T08:50:17.000Z","updated_at":"2024-12-30T02:47:36.000Z","dependencies_parsed_at":"2023-12-19T05:29:47.698Z","dependency_job_id":"89a6bbc7-b346-4578-8f90-bbd453602ee2","html_url":"https://github.com/jeecgboot/MiniDao","commit_stats":null,"previous_names":["zhangdaiscott/minidao"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeecgboot%2FMiniDao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeecgboot%2FMiniDao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeecgboot%2FMiniDao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeecgboot%2FMiniDao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeecgboot","download_url":"https://codeload.github.com/jeecgboot/MiniDao/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245662787,"owners_count":20652084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hibernate","jdbc","jpa","mybatis","mybatis-plus","spring-boot","spring-jdbc","springboot","springjdbc","sql"],"created_at":"2024-07-31T16:00:43.862Z","updated_at":"2025-03-26T13:31:00.971Z","avatar_url":"https://github.com/jeecgboot.png","language":"Java","funding_links":[],"categories":["Java","数据库开发"],"sub_categories":[],"readme":"MiniDao \r\n=======\r\n当前最新版本： 1.10.4 （发布日期：2024-10-30）\r\n\r\n[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)\r\n[![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://jeecg.com/aboutusIndex)\r\n[![](https://img.shields.io/badge/Blog-官方博客-blue.svg)](https://jeecg.blog.csdn.net)\r\n[![](https://img.shields.io/badge/version-1.10.4-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot)\r\n[![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social\u0026label=Stars)](https://github.com/zhangdaiscott/jeecg-boot)\r\n[![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social\u0026label=Fork)](https://github.com/zhangdaiscott/jeecg-boot)\r\n\r\n\r\n\r\n \u003e 反馈问题：发现bug请在github [发issue](https://github.com/jeecgboot/MiniDao/issues/new)\r\n\r\n### MiniDao 简介及特征\r\n\r\nAn powerful enhanced toolkit of SpringJdbc for simplify development\r\n\r\nMiniDao 是一款轻量级JAVA持久层框架，基于 SpringJdbc + freemarker 实现，具备Mybatis一样的SQL分离和逻辑标签能力。Minidao产生的初衷是为了解决Hibernate项目，在复杂SQL具备Mybatis一样的灵活能力，同时支持事务同步。 \r\n\r\n\r\n具有以下特征:\r\n\r\n*  O/R mapping不用设置xml，零配置便于维护\r\n* 不需要了解JDBC的知识\r\n* SQL语句和java代码的分离\r\n* 只需接口定义，无需接口实现\r\n* SQL支持脚本语言（强大脚本语言，freemarker语法）\r\n* 支持与hibernate轻量级无缝集成\r\n* 支持自动事务处理和手动事务处理\r\n* 性能优于Mybatis\r\n* 比Mybatis更简单易用\r\n* SQL 支持注解方式\r\n* SQL 支持独立文件方式，SQL文件的命名规则: 类名_方法名; SQL文件更容易定位，方便后期维护，项目越大此优势越明显\r\n* SQL标签采用[Freemarker的基本语法](http://blog.csdn.net/zhangdaiscott/article/details/77505453)\r\n\r\n\r\n\r\n如何快速集成minidao?\r\n-----------------------------------\r\n\r\n```\r\n\u003cdependency\u003e\r\n  \u003cgroupId\u003eorg.jeecgframework\u003c/groupId\u003e\r\n  \u003cartifactId\u003eminidao-pe\u003c/artifactId\u003e\r\n  \u003cversion\u003e1.10.4\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n- [springboot2与minidao集成](http://minidao.jeecg.com/2392296)\r\n- [springmvc与Minidao集成](http://minidao.jeecg.com/2392293)\r\n\r\n\r\n\t\t\r\n\r\n技术交流\r\n-----------------------------------\r\n* 文 档： [http://minidao.jeecg.com](http://minidao.jeecg.com)\r\n* JEECG低代码： [www.jeecg.com](http://www.jeecg.com)\r\n* 敲敲云零代码： [www.qiaoqiaoyun.com](https://www.qiaoqiaoyun.com)\r\n\r\n项目介绍\r\n-----------------------------------\r\n\r\n| 项目名   |      中文名      |  备注 |\r\n|----------|:-------------:|------:|\r\n| minidao-pe-framework| 架构核心包|     |\r\n| minidao-code-generate |  代码快速生成 |  |\r\n| minidao-pe-spring-boot-starter | spring-boot2 starter  |  |\r\n| minidao-pe-example | 示例代码 |     |\t \r\n\t\r\n\t\r\n支持28种数据库\r\n-----------------------------------\r\n\r\n|  数据库   |  支持   |\r\n| --- | --- |\r\n|   MySQL   |  √   |\r\n|  Oracle、Oracle9i   |  √   |\r\n|  SqlServer、SqlServer2012   |  √   |\r\n|   PostgreSQL   |  √   |\r\n|   DB2、Informix   |  √   |\r\n|   MariaDB   |  √   |\r\n|  SQLite、Hsqldb、Derby、H2   |  √   |\r\n|   达梦、人大金仓、神通   |  √   |\r\n|   华为高斯、虚谷、瀚高数据库   |  √   |\r\n|   阿里云PolarDB、PPAS、HerdDB   |  √   |\r\n|  Hive、HBase、CouchBase   |  √   |\r\n\r\n\r\n\r\n\t\r\n代码体验\r\n-----------------------------------\r\n#### 1. 接口定义[EmployeeDao.java]  \r\n    @MiniDao\r\n    public interface EmployeeDao {\r\n\t\r\n     @Arguments({ \"employee\"})\r\n\t @Sql(\"select * from employee\")\r\n\t List\u003cMap\u003cString,Object\u003e\u003e getAll(Employee employee);\r\n    \r\n     @Sql(\"select * from employee where id = :id\")\r\n\t Employee get(@Param(\"id\") String id);\r\n    \r\n\t @Sql(\"select * from employee where empno = :empno and  name = :name\")\r\n     Map getMap(@Param(\"empno\")String empno,@Param(\"name\")String name);\r\n\r\n     @Sql(\"SELECT count(*) FROM employee\")\r\n     Integer getCount();\r\n\r\n     int update(@Param(\"employee\") Employee employee);\r\n\r\n     void insert(@Param(\"employee\") Employee employee);\r\n\t \r\n\t @ResultType(Employee.class)\r\n\t public MiniDaoPage\u003cEmployee\u003e getAll(@Param(\"employee\") Employee employee,@Param(\"page\")  int page,@Param(\"rows\") int rows);\r\n   }\r\n    \r\n    \r\n#### 2. SQL文件[EmployeeDao_getAllEmployees.sql]\r\n    SELECT * FROM employee where 1=1 \r\n    \u003c#if employee.age ?exists\u003e\r\n\tand age = :employee.age\r\n    \u003c/#if\u003e\r\n    \u003c#if employee.name ?exists\u003e\r\n\tand name = :employee.name\r\n    \u003c/#if\u003e\r\n    \u003c#if employee.empno ?exists\u003e\r\n\tand empno = :employee.empno\r\n    \u003c/#if\u003e\r\n\r\n#### 3. 接口和SQL文件对应目录\r\n\r\n![github](http://www.jeecg.org/data/attachment/forum/201308/18/224051ey14ehqe000iegja.jpg \"minidao\")\r\n\r\n\t\r\n#### 4. 测试代码\r\n    public class Client {\r\n    public static void main(String args[]) {\r\n\t\tBeanFactory factory = new ClassPathXmlApplicationContext(\"applicationContext.xml\");\r\n     \t\t\r\n\t\tEmployeeDao employeeDao = (EmployeeDao) factory.getBean(\"employeeDao\");\r\n\t\tEmployee employee = new Employee();\r\n\t\tString id = UUID.randomUUID().toString().replaceAll(\"-\", \"\").toUpperCase();\r\n\t\temployee.setId(id);\r\n\t\temployee.setEmpno(\"A001\");\r\n\t\temployee.setSalary(new BigDecimal(5000));\r\n\t\temployee.setBirthday(new Date());\r\n\t\temployee.setName(\"scott\");\r\n\t\temployee.setAge(25);\r\n\t\t//调用minidao方法插入\r\n\t\temployeeDao.insert(employee);\r\n\t}\r\n    }\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeecgboot%2FMiniDao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeecgboot%2FMiniDao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeecgboot%2FMiniDao/lists"}