Giter Site home page Giter Site logo

code-generator's Introduction

mybatis自动生成工具

pom.xml集成tomcat插件,直接使用插件启动

表命名规范:

表名以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.

注: 底层依赖framework,本地运行时,需maven仓库包含framework包,具体看framework源码

感谢开源项目

MyBatis

MyBatis Generator

code-generator's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.