Code Monkey home page Code Monkey logo

roncoo-mybatis-generator's People

Contributors

fengyws avatar liaohr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roncoo-mybatis-generator's Issues

项目使用文档

由于官方没写使用说明,我在这里发下。

1、首先将 com/roncoo/mybatis/generator/config/xml/ 目录下的两个 dtd 文件放到 resources 目录。

目录结构如下

输入图片说明

2、修改 com.roncoo.mybatis.generator.plugins.DaoPlugin.javacom.roncoo.mybatis.generator.internal.util.messages.Messages.java

变更 DaoPlugin 类中 Page 和 IdWorker 属性引用路径
private String pagePath = "com.roncoo.education.util.base.Page";
private String pageUtilPath = "com.roncoo.education.util.base.PageUtil";
private String idPath = "com.roncoo.education.util.tools.IdWorker";";

这三个类在均在 roncoo-education-util 项目中,需要在 pom.xml 对其进行引用,否则生成代码的引用路径是错的。你也可以将工具类的代码放在本地,生成之后再修改引用路径。

修改 DaoPlugin#validate 方法

此方法主要是根据 Generator.xml 动态配置生成的代码。因为上面工具类的路径写死了,所以动态配置这里需要注掉。你也可以放到 xml 里进行动态配置。

pagePath = properties.getProperty("pagePath");
pageUtilPath = properties.getProperty("pageUtilPath");
idPath = properties.getProperty("idPath");
变更 Messages 类中 BUNDLE_NAME 属性引用路径

改成加载自己当前包下的 messages.properties

private static final String BUNDLE_NAME = "com.roncoo.mybatis.generator.internal.util.messages.messages"; 

3、配置 Generator.xml

主要配置 roncoo 后期添加的一些 plugin。我把一些主要的贴在下面
<plugin type="com.roncoo.mybatis.generator.plugins.SerializablePlugin"/>
<plugin type="com.roncoo.mybatis.generator.plugins.ToStringPlugin"/>
<plugin type="com.roncoo.mybatis.generator.plugins.DaoPlugin">
    <!-- ServiceImpl方法的名称 -->
    <property name="enableInsertSelective" value="true"/>
    <property name="enableDeleteByExample" value="false"/>
    <!-- 支持count和page -->
    <property name="enableCount" value="true"/>
    <property name="enablePage" value="true"/>
    <!-- Service和ServiceImpl的目录和路径,其中targetProject必须填写否则执行报错 -->
    <property name="targetPackage" value="${target.package}.dao"/>
    <property name="targetProject" value="${target.project}"/>
    <property name="implementationPackage" value="${target.package}.dao.impl"/>
</plugin>

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.