https://github.com/fartherp/code-generator-core
自动生成自定义mybatis基础代码
https://github.com/fartherp/code-generator-core
mybatis mybatis-generator spring
Last synced: 3 months ago
JSON representation
自动生成自定义mybatis基础代码
- Host: GitHub
- URL: https://github.com/fartherp/code-generator-core
- Owner: fartherp
- License: apache-2.0
- Created: 2017-12-26T08:58:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T01:36:28.000Z (about 7 years ago)
- Last Synced: 2025-01-07T21:35:32.265Z (5 months ago)
- Topics: mybatis, mybatis-generator, spring
- Language: Java
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# mybatis自动生成工具
### 表命名规范:
表名以tb_或td_开头(留个好习惯),如:菜单表:tb_menu### Framework生成的文件
#### JAVA文件
* Bo
基本对象,对应数据库相应的表信息。
如:菜单表,MenuBase,Menu两个类Base对应的是数据的各个字段信息,非Base类是对基础类的扩展.
* Dao
持久层。
如:MenuMapper,对应mybatis文件中相应的SQL方法.MenuDao,MenuDaoImpl.
* Service
service层,事务配置在此.
如:MenuService,MenuServiceImpl.
目前只能使用XML方式来配置事务.基本方法中增删改查为,save,update,del,find.#### XML文件
* xml文件mapper。
如:BaseMenuMapper.xml,基础XML文件,包括增删改查方法。MenuMapper是XML的扩展,自定义方法放在里面。
### PPms生成的文件
#### JAVA文件
* Po 基本对象. 如:Menu,对应表的各个字段信息.
* Dao dao层. 如:MenuDao.对应mybatis文件中相应的SQL方法.
* Service service层. 如:MenuService,MenuServiceImpl.
* Action action层. 如:Action.#### XML文件
* xml文件mapper. 如:MenuMapper.xml. 基本方法中包括增(insert),批量增(insertBatch),改(update),删(delete),查(get),查列表(列表),分页(findPage).#### spring文件
* spring对应的action, servlet, tx.
### 感谢开源项目

---
[MyBatis Generator](https://github.com/mybatis/generator.git)